WordPress.org

Ready to get started?Download WordPress

Forums

Which code show the list of post in category on pages ? (6 posts)

  1. SevenT
    Member
    Posted 8 months ago #

    Hi all,i want the page have the list of post in the category.Sound it is easy but i just a newbie so i dont know what code to do that.

    Pleasse help me

    Thanks for your listing and helping me :)

  2. manojrohtela
    Member
    Posted 8 months ago #

    <?php
        $args = array( 'category' => 7, 'post_type' =>  'post' );
        $postslist = get_posts( $args );
        foreach ($postslist as $post) :  setup_postdata($post);
        ?>
        <h2><a>"><?php the_title(); ?></a></h2>
        <?php the_excerpt(); ?>
        <?php endforeach; ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code has now been permanently damaged by the forum's parser.]

  3. SevenT
    Member
    Posted 8 months ago #

    Thanks you so much but when i insert it in "edit page" it didnot show,it just show $args = array( 'category' => 6, ‘post_type’ => ‘post’ );
    $postslist = get_posts( $args );
    foreach ($postslist as $post) : setup_postdata($post);
    ?>
    “>

    Do you have the short code like show all mesage which have form [post_list preset="posts_xxxx"]

  4. manojrohtela
    Member
    Posted 8 months ago #

    it will not work in page editor...for that you have to used plugins.....

  5. manojrohtela
    Member
    Posted 8 months ago #

    http://wordpress.org/plugins/advanced-post-list

    use this plugin....i think it will work

  6. manojrohtela
    Member
    Posted 8 months ago #

    http://wordpress.org/plugins/tpg-get-post

    i used dis plugin ....it worked fined....so you can use this

Reply

You must log in to post.

About this Topic

Tags

No tags yet.