admin管理员组文章数量:1424902
Currently, we are getting all posts from a specific category using the following:
$args = array(
'post_type' => array('post'),
'cat' => 1247,
'posts_per_page' => 4
);
What we'd like to do is get all posts from cat 1247 and also from custom post type 'videos', such as:
$args = array(
'post_type' => array('post', 'videos'),
'cat' => 1247,
'posts_per_page' => 4
);
However, as none of the posts in 'videos' are from category '1247', it's only showing posts from '1247', however I can't seem to find a category for posts in video?
How would we go about achieving what we need to achieve?
本文标签: loopDisplay all posts from specific category and CPT
版权声明:本文标题:loop - Display all posts from specific category and CPT 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745438869a2658354.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论