Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other how to get custom posts for custom taxonomy ? Reply To: how to get custom posts for custom taxonomy ?

#151782
amis
Participant

thx Energ

i have been used this but not work with me

 <?php
$args = array(
'post_type' => 'videos',
'tax_query' => array(
'relation' => 'AND',
),
array(
'taxonomy' => 'type',
'field' => 'slug',
'terms' => array( $term->slug )
                    )
);
$query = new WP_Query( $args );
?>
<?php if(have_posts()) : ?>
   <?php while(have_posts()) : the_post(); ?>

i will show you what i want defiently

i want when go to this link get what in it

http://localhost/wp/?type=comedy (get comedy only )

http://localhost/wp/?type=action (get action only)