0
A
回答
0
雖然我沒有在一個小而人氣-大賽的工作,我認爲這應該工作:
/**
* Define the categories to be tracked
*/
$GLOBALS['pc_track_cats'] = array(1,3,5,8); // alternately, category slugs can be used as well
/**
* Check the content each time it is called to see if we're in our target cat
* if not, remove the popularity-contest filter
*
* @param string $the_content
* @return string
*/
function my_check_pc($the_content) {
if (!in_category($GLOBALS['pc_track_cats'])) {
remove_filter('the_content', 'akpc_content_pop');
}
return $the_content;
}
add_filter('the_content', 'my_check_pc', 1);
/**
* Replace the popularity contest filter after the content has been run
*
* @param string $the_content
* @return string
*/
function my_replace_pc($the_content) {
add_filter('the_content', 'akpc_content_pop');
return $the_content;
}
add_filter('the_content', 'my_replace_pc', 9999);
相關問題
- 1. angularjs只在特定的WordPress的帖子
- 2. WordPress - 只顯示父類別的帖子不是子類別的帖子
- 3. 如何跟蹤WordPress的帖子(視圖,份額)的「流行度」以呈現類別中的「最熱門」帖子?
- 4. WordPress的:從特定類別的帖子生成標籤陣列
- 5. WordPress的:獲取特定類別的帖子
- 6. Wordpress顯示特定類別下的所有帖子
- 7. 用戶從特定類別的帖子數[Wordpress]
- 8. 將wordpress評論發佈爲特定類別的帖子
- 9. 從特定類別檢索CPT帖子| WordPress的
- 10. WordPress的子類別與帖子標題
- 11. 鏈接類別帖子(Wordpress)
- 12. 將帖子限制在特定的類別和子類別
- 13. WordPress的 - 從子類別列出的自定義帖子類型
- 14. 只顯示帖子的子類別
- 15. 在Wordpress中顯示類別的帖子?
- 16. WordPress的類別和帖子priting
- 17. WordPress的:顯示類別帖子
- 18. 從特定類別拉最新帖子
- 19. wordpress - 帖子頁面上的同一類別的其他帖子
- 20. 在Wordpress中顯示帖子的類別和子類別列表
- 21. WordPress的類別 - 列表帖子和子類別
- 22. WordPress:如何只顯示某個類別的帖子?
- 23. WordPress的私人帖子
- 24. WordPress:防止顯示子類別帖子
- 25. 打電話給WordPress我的帖子基於人氣
- 26. WordPress的自定義帖子類型 - 無效的帖子類型?
- 27. 限制wordpress中自定義帖子類型的類別
- 28. WordPress的不能添加類別自定義帖子類型
- 29. 自定義帖子類型中的Wordpress列表類別
- 30. WordPress的顯示帖子與特定的三個類別的分頁