Display page slug in category_name

I’m trying to display posts by their category on a page template. I’m thinking the best way to do this would be to give my post categories the same slugs as the pages that would display the categories posts.

Is there a way to put the page slug in the below code?

$wpb_all_query = new WP_Query(array(‘post_type’=>’businesses’, ‘post_status’=>’publish’, ‘county_name’=>’Use Page Slug Here’, ‘posts_per_page’=>-1)); ?>

Thanks for any help

Read more here:: Display page slug in category_name

Leave a Reply

Your email address will not be published. Required fields are marked *