2016-11-25 183 views
0

Post有一定的數據可以在blog導航菜單使用index.php和單個帖子從single.php檢索數據。我也有另一個custom post typeclient可以從Our- client導航菜單查看,它使用client template。現在的問題是我也想單個客戶端的自定義單個頁面,所以我使用single-client.php,但是當我點擊任何客戶端它導致single.php而不是single-client. php自定義帖子類型的多個單一帖子

回答

0

您可以複製例如所有內容。 page.php,並將其粘貼到您自己的模板中。在代碼的頂部,粘貼此代碼

<?php 
/** 
* Template Name: Your template name 
* 
*/ 

此後,您可以在頁面選項中找到模板,以在Wordpress中編輯頁面。在此 看看更多信息 https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/

編輯:我只是通過你的問題讀一遍,好像這是你:http://www.wpbeginner.com/wp-themes/create-custom-single-post-templates-for-specific-posts-or-sections-in-wordpress/

0

我認爲你已經使用相同的模板名稱的兩個頁面。

For single-post.php 
<?php 
/** 
* Template Name: Your Single-Post page 
* 
*/ 
For single-client.php 
<?php 
/** 
* Template Name: Your Client page 
相關問題