• Resolved SaraGraybill

    (@saragraybill)


    I need to filter the events feed on my site by the featured category. I’m using WP_query to do the feed in a custom template. It works fine until I add the category. Below is the $args I’m using. Did I not set them up them correctly?

    $args = array(
    			'post_type' => 'events', // enter your custom post type
    			'meta_key' => 'start_date',
    			'orderby' => 'meta_value',
    			'order' => 'DESC',
    			'posts_per_page'=> '4',
    			'tax_query' => array(
    				         array(
    					'taxonomy' => 'event-categories',
    				        'field' => 'term_id',
    	            			'terms' => '59',
    					),
    					), 
    			);

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Filter WP_query by category’ is closed to new replies.