wordpress模板制作中,如果不想讓某個分類的標簽出現在tag.php頁面中,可以通過以下的方法實現:

1、在tag.php文件中找到

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

2、將這段代碼改寫成

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

代碼說明:上面的數字即為要排除的指定分類目錄的ID

按上面的方法簡單修改一下代碼,就可以實現wordpress網站的對tag的靈活調用,是不是很簡單呢,你學廢了嗎