这必须是可能的,但我无法找到任何文件。我正在尝试显示某个类别和标签的帖子。像这样:
if (in category 'featured' and has tag 'gcse') { output 3 most recent posts }
这是我的蹩脚尝试,显然无效:
<?php
get_the_category()
$args = array('tag_slug_' => array('gcse'),category=featured);
$postslist = get_posts( $args );
foreach ($postslist as $post) : setup_postdata($post); ?>
<ul>
<li><?php the_title(); ?></li>
</ul>
<?php endforeach; ?>
由于
答案 0 :(得分:0)
我明白了......
<?php $postsLatest = get_posts('&tag=gcse&category=24&numberposts=3'); foreach($postsLatest as $post) { ?>
<h4><a href="<?php the_permalink() ?>" target="_parent"><?php the_title(); ?></a></h4>
<?php } ?>