简体   繁体   中英

How to display private (or draft) Wordpress blog post outside blog

I would like WordPress to use as a edit tool and my website as a renderer, but don't want to posts created for website display on my blog. So I did this on my website:

  • created private post
  • put on website this:

    define('WP_USE_THEMES', true); require('blog/wp-load.php');

    $args = array( 'post_status' => 'private', 'p' => '3019' ); query_posts( $args );

    ?>

Unfortunately it does not work.

When i set p to post id that is published it works. When i publish my private post as public it works too. But when post is private it does not work.

What to do to make this work?

我想利用get_posts会更容易.. http://codex.wordpress.org/Template_Tags/get_posts

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM