-1
我有问题,我无法获取该类别的相关产品,谁能告诉?相关产品按类别wordpress
<?php
global $post;
$args = array(
'post_type' => 'twin_posts',
'showposts' => 4
);
$categories = get_the_category($args);
$old_query = $wp_query;
$wp_query = new WP_Query($args);
?>
<ul class="ps-list row">
<?php
while (have_posts()) : the_post();
endwhile;
$wp_query = $old_query;
?>
</ul>