Theme displaying posts by categories

  • Unknown's avatar

    Are there any themes which separate posts by categories on the home page? But not a static page.

    I’ve looked until my eyes bleed but have yet to find one, thought I should go direct to the experts. Thanks.

    The blog I need help with is: (visible only to logged in users)

  • Hi mrfleas!

    You can achieve this on any theme using the Display Posts Shortcode:
    https://en.support.wordpress.com/display-posts-shortcode/

    You have a more detailed explanation on the above link, but the gist of it is using multiple instances of this shortcode and changing the category for each block

    [display-posts category="your-category" posts_per_page="20"]

    I hope that helped.

  • Unknown's avatar

    Hi mrfoxtalbot, thanks for the reply.

    I’m not sure where to add this shortcode. It says in a page but I haven’t an editable home/front page, only editable additional/optional pages. Specifically I’m wanting to change the presentation of the front page.

    But it proves it can be done with code, I’m surprised it hasn’t been offered as a set theme and not just as a user work around.

    I will play with the codes and see what happens. Thanks again. :)

  • Hi, mrfleas! You are very welcome.

    I forgot to mention you need to take an extra step. Create a page (or choose an existing page) and assign it as a “Homepage”. You can see how to do that here:

    Set the Homepage

    Then paste the code there. You can add content before, between and after the shortcde, for instance:

    <h2>Fist Category</h2>
    [display-posts category="first-category" posts_per_page="6"]
    <h2>Second category</h2>
    [display-posts category="second-category" posts_per_page="6"]

    Good luck and please let me know how that goes.

  • Unknown's avatar

    mrfoxtalbot,

    Ha ha, I’m right beside you – just fathomed that step is available!
    So although it’s called a “static” page, it can actually change appearances/update itself with the short code?

    Okay, this has possibilities. Thanks once again.

  • mrfleas,

    Yeah, the “static” thing is a bit of a misnomer… I am glad to hear that helped, please ask if you need anything else.

    Cheers!

  • The topic ‘Theme displaying posts by categories’ is closed to new replies.