1
我有不同的電影類別,但我希望電視劇的帖子與其他類型有不同的佈局。根據帖子類別顯示特定代碼
<?php
if (in_category("drama")){
//activate a specific code
}
elseif (in_category("other genre")){
//activate a different code
我有不同的電影類別,但我希望電視劇的帖子與其他類型有不同的佈局。根據帖子類別顯示特定代碼
<?php
if (in_category("drama")){
//activate a specific code
}
elseif (in_category("other genre")){
//activate a different code
有可用來實現您的要求,一些有用的插件,
下面幾個有用的插件, https://wordpress.org/plugins/custom-category-template/ https://wordpress.org/plugins/custom-category-templates/
我發現張貼我的答案後,這個鏈接。認爲它可能會幫助你,http://stackoverflow.com/questions/38386487/wordpress-functions-php-use-different-page-template-for-each-post-category – manian