Give Wordpress custom page template a title for ap

2019-08-13 00:42发布

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.

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

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

3条回答
等我变得足够好
2楼-- · 2019-08-13 00:59

Yes, you need to provide a proper formatted URL (permalink) to wordpress Like either you want a dash (-) OR Forward Slash (/) OR whatever you want.

For this Go to Admin Panel > Appearance > Permalinks, here you can see the different styles of permalinks.You can create your own permalink structure too.

Find the attachment for your help.

enter image description here

查看更多
疯言疯语
3楼-- · 2019-08-13 01:00

I don't think so. The reason being that single-{type} pages are not essentially a required part of WordPress Template files, where as page.php is as it is used to for all static WordPress pages.

So it makes sense that WordPress people set a neat title for page.php and left single-{type} pages unattended. Also, type of single-{type} pages are user defined and subject to variation; where as page.php templates are not.

You may refer this page from WordPress Codex for more information

查看更多
爷、活的狠高调
4楼-- · 2019-08-13 01:15

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

查看更多
登录 后发表回答