how do I do this?
-
How can I make this query use a variable (like post title or slug) instead of hard coding the category name in?
Like change this from$query = new WP_Query( 'category_name=staff' );
to maybe something that will do this
$query = new WP_Query( 'category_name= "get the slug or title of the post which will also be the category of the posts I want to display ' );
So that the same code can be ran for anything that shows up in the posts titles or slugs?
[duplicate thread – https://www.ads-software.com/support/topic/can-someone-please-help-me-with-this-multiple-loop-and-categories-please?replies=6%5D
- The topic ‘how do I do this?’ is closed to new replies.