最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Dynamic template for single custom post

programmeradmin1浏览0评论

I am trying to create a dynamic template for all custom post types I create. I understand I can put the post type slug in "Template Post Type:" in the header comments of my template but how can I populate this dynamically?

eg. this is how I would like my header comments to work but I obviosuly can't use a variable in the comments .

<?php
$custom_post_types = 'post, page, my_custom_post_type1, my_custom_post_type2';

/**
 Template name: Home
 Template Post Type:  $custom_post_types 
*/
?>
发布评论

评论列表(0)

  1. 暂无评论