I'm returning to WP after some time away, and find I've forgotten what little I knew.
I have some pages on a site that display a post of given category, which was done with a line like: query_posts($query_string . '&cat=2');
followed by:
if ( have_posts() ) : while ( have_posts() ) : the_post();
etc. etc. ending with (else) 'Sorry, no posts matched your criteria'
I have defined a category 'Services', and assigned a test post to this category. I can see in wp_terms
that the category has the term_id of 2 and name of 'Services', but the post isn't getting picked up.
Where is the post 'told' what its category is? Should I be expecting to see a field for category_id
(or cat_id
) somewhere? It's certainly not in the wp_posts
record.
Or, in other words, where is the query string &cat=2
picked up?
It certainly used to work, but that was a while ago and maybe some updates to WP or PHP now require a change?