我正在尝试修改一个旧主题,但我被这段代码卡住了
$post_type = \'portfolio\' == get_post_type() ? \'portfolio\' : \'post\';
if ( ! themify_check( "setting-{$post_type}_nav_disable" ) ) :
$in_same_cat = themify_check( "setting-{$post_type}_nav_same_cat" )? true: false;
$this_taxonomy = \'post\' == get_post_type() ? \'category\' : get_post_type() . \'-category\';
$previous = get_previous_post_link( \'<span class="prev">%link</span>\', \'<span class="arrow">\' . _x( \'«\', \'Previous entry link arrow\',\'themify\') . \'</span> %title\', $in_same_cat, \'\', $this_taxonomy );
$next = get_next_post_link( \'<span class="next">%link</span>\', \'<span class="arrow">\' . _x( \'»\', \'Next entry link arrow\',\'themify\') . \'</span> %title\', $in_same_cat, \'\', $this_taxonomy );
if ( ! empty( $previous ) || ! empty( $next ) ) : ?>
<div class="post-nav clearfix">
<?php echo $previous; ?>
<?php echo $next; ?>
</div>
<!-- /.post-nav -->
<?php endif; // empty previous or next
endif; // check setting nav disable
这一部分具体。目前它列出了我所有的文章,但我不知道如何只列出类别id1
2
3
$this_taxonomy = \'post\' == get_post_type() ? \'category\' : get_post_type() . \'-category\';