Show all categories recent posts on home page
URL to the page in question:
-
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
I believe this is what you’re looking for:
If you have any trouble, let me know.
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?
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
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
I’m just glad that works now. Enjoy your weekend.
- The topic ‘Show all categories recent posts on home page’ is closed to new replies.