Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other WordPress Theme development: How to show category based post in home page?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #41675
    sshuvro58
    Participant

    Suppose I have 3 categories (cat 1 , cat 2 , cat 3) , and my blog home page shows 6 recent posts . I want to show 2 recent posts from every category.

    Like

    cat 1 :

    Post 1

    Post 2

    cat 2:

    Post 1

    Post 2

    cat 3 :

    Post 1

    Post 2

    how can I do it ? Thanks in advance

    #119394
    Andy Howells
    Participant

    You will probably need to run 3 separate query loops to do what you need, specifying the different categories and number of posts in each.

    #119395
    sshuvro58
    Participant

    Thanks andy_unleash

    In the above code , where should put parameter for category , what modification I need to do .

    #119401
    Andy Howells
    Participant

    Your best bet is to have a good read of the [Query Posts Codex](http://codex.wordpress.org/Function_Reference/query_posts)

    In particular the examples and parameters section – [parameters & categories etc](http://codex.wordpress.org/Function_Reference/query_posts#Examples)

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Other’ is closed to new topics and replies.