WordPress.org

Ready to get started?Download WordPress

Forums

post of a category (2 posts)

  1. kikko088
    Member
    Posted 3 years ago #

    Hi at all, I try to do a little hack but I have some problem, I want to display on a post of category1 the rest of the category1 posts, obviusly the code must be dinamyc if I'm on cat2 the rest of post must be of the cat2
    how can do this?

    kikko088

  2. kkarpieszuk
    Member
    Posted 3 years ago #

    in the loop save ID of category:

    $cats = get_post_categories();
    $cat = $cats['0'];

    and after this insert second loop but before it add:

    wp_reset_query();
    query_posts('cat='.$cat);

    remeber that you can assign one posst to many categories. this solution will show only posts from one category

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.