GS | Webkey

How to display posts of particular categories?

‘gallery’,
‘posts_per_page’ => -1,
‘tax_query’ => array(
array(
‘taxonomy’ => ‘categories’,
‘field’ => ”, // search by slug name, you may change to use ID
‘terms’ => ”, // value of the slug for taxonomy, in term using ID, you should using integer type casting (int) $value
),
)
);

$new_query = new WP_Query($args);
while($new_query -> have_posts()) : $new_query -> the_post();
$url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
?>

  • “>
  • Leave a comment

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