Wordpress Snippets

Archive Page For Custom Taxonomy

Here is the Query. Highlighted content will have to be changed for your case.

<?php 
$my_query = new WP_Query( array(
'post_type' => 'company',
'tax_query' => array(
  array(
    'taxonomy' => 'service',
    'field'    => 'slug',
    'terms'    => get_query_var( 'service' ),
  ),
),
'paged'   => get_query_var('paged', 1),
) ); ?>

Also refer: Query Anything On WordPress Anywhere

Hire Us. Or just say Hi!
Need a job? Apply to get one.