Show all categories recent posts on home page

Support Area Forums Foundation Show all categories recent posts on home page

Viewing 6 posts - 1 through 6 (of 6 total)
URL to the page in question:
  • Author
    Posts
  • #5026
    Christian Hine
    Participant

    Hi,
    I’m trying to adjust home.php to allow all the most recent posts, regardless of category, to appear on the front page….but still use the number limit set in theme options.

    I know the code is here:

    have_posts()) : $recent->the_post();?>

    I have tried every adjustment I can think of to “cat=” and I end up with a plethora of different parse errors and the site won’t load.

    The correct syntax would be appreciated.

    Cheers,
    Christian

    #5027
    Bill Robbins
    Moderator

    I believe this is what you’re looking for:

    If you have any trouble, let me know.

    #5036
    Christian Hine
    Participant

    Hi,
    Yes, that is actually what I tried (amongst many other combos). This particular string leads to this error upon page refresh:

    Parse error: syntax error, unexpected ‘}’ in /home/content/p/e/l/pellinhine/html/proceedwithcaution/wp-content/themes/foundation/home.php on line 47

    Thoughts?

    #5039
    Bill Robbins
    Moderator

    That sounds like it’s not directly related to the category, but most likely something wrong with a conditional tag that has the first part removed, but the ending bracket remaining.

    I tested this full code for the bottom section to show all posts and it didn’t pull up an error:

    If you still get an error, post the complete code for your home.php file to gist.github.com and post the link here and I’ll see if I can spot anything odd.

    Thanks

    #5040
    Christian Hine
    Participant

    This is just weird. Thankfully, your full code works when I exchanged it with what was currently there. I just can’t for the life of me see the difference between what was tried previously and this. Oh well, don’t look a gift horse in the mouth!
    Thanks,
    Christian

    #5042
    Bill Robbins
    Moderator

    I’m just glad that works now. Enjoy your weekend.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Show all categories recent posts on home page’ is closed to new replies.