简体   繁体   English

如何在Wordpress的不同页面上使用一个模板?

[英]How can i use one template on different pages in wordpress?

How can I use one template on different pages in WordPress ? 如何在WordPress的 不同页面上使用一个模板 If I am using template the WordPress page content is not showing, and if I am not using the WordPress template then only I can see my template. 如果我使用的模板未显示WordPress页面内容,并且如果我未使用WordPress模板,则只有我可以看到我的模板。

You can use one template in different pages in WordPress by assigning the page template option on the right drop down to the template you want to use. 您可以在WordPress的不同页面中使用一个模板,方法是在右侧下拉菜单中将页面模板选项分配给要使用的模板。

在此处输入图片说明

if you want to create a custom page and use it as a template in your website you can find detailed steps here , just remember to change the top of your template comment 如果要创建自定义页面并将其用作网站中的模板,可以在此处找到详细步骤,只需记住更改模板注释的顶部即可。

     <?php
/*
Template Name: write here your custom name for template 
*/
get_header(); ?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WordPress-如何为不同的页面分配单独的样式表? - Wordpress - How can I assign separate stylesheets to different pages? 我可以合并两个不同的 wordpress 主题并将其用作一个网站吗? - Can I merge two different wordpress themes and use it as one website? 如何在 Wordpress 中动态使用页面模板文件? - How can I in Wordpress use page template file dynamically? 如何从 header 获取 cookie 值到 wordpress 中的模板页面? - How can i get the cookie value from header to template pages in wordpress? 如何在Wordpress中的不同页面上使用不同的Google Analytics(分析)代码 - How to use different google analytics code for different pages in wordpress 如何在 Wordpress 中自定义类别页面? - How can I customize category pages in Wordpress? 更改不同页面的自定义模板的内容-Wordpress - Change content of a custom template for different pages - Wordpress 如何使用jQuery在Wordpress中的特定页面上加载不同的图像 - How to use jQuery to load different images on specific pages in Wordpress 如何使用条件Wordpress语句将特定代码从页脚传递到特定页面 - How can I make use of conditional Wordpress statement to deliver specific code from footer to specific pages 如何使用PHP在模板的某些页面上放置特定的HTML? - How can I use PHP to place specific HTML on Certain Pages of my Template?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM