Skip to content
Advertisement

WordPress: Latest post missing from category feed

I have setup a custom field to pull a specified category ID to display using WP_Query on a page’s side bar. It pulls the posts in the correct category, but skips the most recent one. Here is the snip of code:

JavaScript

Even when I simplify the WP_Query and remove the variable like this:

JavaScript

It still skips over the latest post within that category.

Any insight would be greatly appreciated, thank you!

Advertisement

Answer

you need to check if $catquery->have_posts() for example –

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement