Last updated on September 26, 2018
In the new version of WordPress 4.7, the flexibility of WordPress's template system is further enhanced by expanding the page template capacity to all types of articles. In addition to adding the Template Name parameter to the file header, you also need to specify the Template Post Type: post, foo, bar. Here is an example:
<? php /* Template Name: Full-width layout Template Post Type: post, page, product */ // ... Template code ;?>
In this way, you can choose to use the full width layout page template in post, page, product and other types of articles. As long as your theme has a template suitable for the article, the "Post Attributes" option box will appear on the background article editing page. This "Post Attributes" title can be defined when registering article types.
What if you want to enable the custom article type template selection function? Just change the post to your custom post type:
<? php /*Template Name: Excavator Article Template Template Post Type: app/* custom post type*/ */ // ... Template code ;?>
Small beast wordpress relies on years of Wordpress enterprise theme Production experience, adhering to the purpose of "wordpress theme born for users", has provided quality wordpress website building services for more than 100000 customers, and has received unanimous praise from customers. We always treat every customer with our heart. We firmly believe that "treat customers well, and they will become lifelong customers". Wordpress can persist for many years because we are always honest. We clearly mark the price( How much does wordpress cost to build a website )We never cheat any customer. Our quotation tenet is: "refuse to make excessive profits and only keep reasonable profits". If you have a need for website construction, website revision, website maintenance, etc., please immediately consult the online customer service on the right or call the hotline: 18907337671, and we will answer your questions one by one in detail.