1

domain.com/?cat=id custom taxonomy not get post but category get to post

How do you write wp_query get post taxonomy?

<?php
$args_my_query = array(
    'post_type'    =>    'post',
    'taxonomy' =>  'khu-vuc',
    'field' => 'id',
    'terms' => array($post->ID),
);
$my_query = new WP_Query( $args_my_query );
?>

code in file search.php

  • 1
    Are you trying to filter search so it only searches inside a category? Your english is a little difficult to understand – Tom J Nowell Apr 13 '17 at 16:12
  • i cant domain.com/?cat=id get post custom taxonomy – Cao Văn Lâm Apr 16 '17 at 7:31
  • I don't understand, please say what you are trying to do, what you did, what you expected, and then what actually happened – Tom J Nowell Apr 16 '17 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.