wordpress模板制作中,如果不想讓某個(gè)分類(lèi)的標(biāo)簽出現(xiàn)在tag.php頁(yè)面中,可以通過(guò)以下的方法實(shí)現(xiàn):

1、在tag.php文件中找到

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

2、將這段代碼改寫(xiě)成

<?php if (have_posts()) : query_posts($query_string .'&cat=-1,-2,-3,-666,-888');?>
<?php while (have_posts()) : the_post(); ?>

代碼說(shuō)明:上面的數(shù)字即為要排除的指定分類(lèi)目錄的ID

按上面的方法簡(jiǎn)單修改一下代碼,就可以實(shí)現(xiàn)wordpress網(wǎng)站的對(duì)tag的靈活調(diào)用,是不是很簡(jiǎn)單呢,你學(xué)廢了嗎