为Wordpress自定义页面模板赋予外观编辑器标题 [英] Give Wordpress custom page template a title for appearance editor

查看:188
本文介绍了为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

这篇关于为Wordpress自定义页面模板赋予外观编辑器标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆