WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently, I makes a plugin, and I want to display some post in admin submenu, my url looks like


how to display posts list on my plugin page? it's possible or not?


Please delete this post, I just found solution:

$query = new WP_Query(
        'post_type' => 'post',
        'post_status' => 'publish'

$list = array();
foreach ($query->posts as $post) {
share|improve this question
Instead of deleting you can just write your solution in an answer and accept it. – fdsa Aug 13 '12 at 1:26

Better would be the use of WordPress' function get_posts():

$args = array(
    'post_type' => 'post',
    'post_status' => 'publish'

$posts = get_posts( $args );

echo '<ul>';

foreach ( $posts as $post ) {
    echo '<li>' . $post->post_title . '</li>';

echo '</ul>';


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.