0
A
回答
0
在content.php
文件更改:
<?php if (comments_open()) : ?>
<div class="comments-link">
<?php comments_popup_link('<span class="leave-reply">' . __('Leave a reply', 'twentytwelve') . '</span>', __('1 Reply', 'twentytwelve'), __('% Replies', 'twentytwelve')); ?>
</div><!-- .comments-link -->
<?php endif; // comments_open() ?>
到
<?php
$postid = get_the_ID();
$category = get_the_category($postid);
$category = $category[0]->cat_name;
if ($category == "Pear")
{
if (comments_open()) : ?>
<div class="comments-link">
<?php comments_popup_link('<span class="leave-reply">' . __('Leave a reply', 'twentytwelve') . '</span>', __('1 Reply', 'twentytwelve'), __('% Replies', 'twentytwelve')); ?>
</div><!-- .comments-link -->
<?php endif; // comments_open()
}
?>
,並在comments.php
文件更改:
<?php if (have_comments()) : ?>
到
<?php
$postid = get_the_ID();
$category = get_the_category($postid);
$category = $category[0]->cat_name;
if ($category == "Pear")
{
if (have_comments()) :
?>
和變化:
<?php endif; // have_comments() ?>
<?php comment_form(); ?>
到
<?php endif; // have_comments() ?>
<?php comment_form();
}
?>
上面只顯示那些在Pear
類職位的意見。
相關問題
- 1. 顯示評論僅供特定類別
- 2. 在wordpress中的類別頁面上顯示評論
- 3. Facebook的評論模塊不會在桌面上顯示評論
- 4. 頁面上的評論不會顯示
- 5. 在同一頁上顯示評論和發佈表單以添加新評論
- 6. Yelp評論不顯示
- 7. 評論如何在Facebook上即時顯示評論?
- 8. 在Facebook上只顯示朋友的評論社交評論插件fb:評論
- 9. 在Facebook上顯示圖片評論而不顯示網址?
- 10. Wordpress喜歡顯示奇/偶評論瓦特/不同類 - jQuery?
- 11. 在WordPress主頁上顯示評論
- 12. 如何在tabcontent上顯示評論?
- 13. 未在手機上顯示Facebook評論
- 14. 在圖像上顯示評論
- 15. 錯誤不能顯示在Facebook的評論所有評論
- 16. 在UITableView中顯示評論
- 17. Facebook的評論小工具發表評論不顯示在牆上的圖像
- 18. 如何禁用Facebook評論顯示在博客主頁和類別頁面上?
- 19. 評論不顯示在wordpress 3.1
- 20. ExpressionEngine在沒有評論時不顯示
- 21. Facebook評論插件不顯示在iframe
- 22. 在不同的頁面上顯示不同的類別?
- 23. 如何在同一頁面上顯示評論? cakephp
- 24. 在同一頁面上使用jquery_ujs顯示評論
- 25. 如何在同一頁面上顯示以前的評論
- 26. 顯示刪除評論上的鏈接
- 27. jquery只顯示上次評論
- 28. 在定製的ActiveAdmin顯示頁面上顯示評論框
- 29. Doxygen的不顯示任何特別的評論
- 30. 如何在顯示Wordpress評論數的計數中顯示Facebook評論?