3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
There are two things you need to do. First, copy and paste the code in your function.php file. Second, find the single.php in your theme folder. This file is the template of posts. Duplicate it, and rename as single-{Post ID}.php. add_filter( 'single_template', 'check_post_custom_template'); function check_post_custom_template($template){ global $post; $custom_template = locate_template( "single-{$post->ID}.php" ); if ( ! empty( $custom_template ) ) { $template = $custom_template; } return $template; } And how to get your Post ID? You can enter the post edit page, then get it in the link. For example, the edit page link of the post is below, and “post = 123456” is your post ID. https://aronhack.com/wp-admin/post.php?post=123456&action=edit Related Posts The Complete WordPress Customization Tutorial – Just Copy And Paste And Work

本文由aronhackcom提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦