给Wordpress自定义页面模板出现编辑器的标题

问题描述:

当在Wordpress主题外观编辑器中,某些页面有一个整齐的标题显示在您的主题文件的右侧列表中。例如,page.php显示为页面模板。这是干净,容易阅读。

When in Wordpress theme appearance editor, certain pages have a neat titles displayed in the right hand list for your theme files.For example page.php shows as "Page Template". This is clean and easily read.

Wordpress用于为自定义页面模板提供这些标题的注释语法吗?

Is there any comment syntax that Wordpress uses to give these titles for my custom page template?

,我的single-video.php页面可以是视频页面模板。

For example, my single-video.php page could be "Video Page Template".

确保您的网页打开时包含以下内容:

Yes you can. Make sure your page opens with something like:

<?php /** Template Name: Text & Image 
*/ get_header(); ?>

在这种情况下,文件概述中的文件名称(在外观编辑器中):文本&图片页面模板

In this case the name of the file in your file overview (while in your appearance editor): Text & Image Page Template