Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have 10 category, and when i select a category in the sidebar il list all the post from that category.... FINE, beautiful

Now, i like a page, with some text and photos and then after that content, i like to have all the post from a category listed, just like the category view...

Is there a plugin or a short code that just do that ?

share|improve this question
    
search the plugins for 'list category posts' wordpress.org/extend/plugins/search.php?q=list+category+posts –  Michael Mar 9 '12 at 21:48
add comment

1 Answer

up vote 1 down vote accepted

Try this...

<?php
function list_post(){

    //or you can use the cat id here, check the codex for WP_Query
    $q = new WP_Query(array('category_name' => '<cat slug here>'));
    if($q->have_posts()):
        while($q->have_posts()):the_post();
            the_title();
        endwhile;
    else:
        echo "No posts found!";
    endif;
    wp_reset_postdata();
}

add_shortcode('list_post', 'list_post');
?>
share|improve this answer
add comment

Your Answer

 
discard

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.