<?php
/* Template Name: ContactTemplate (like this try giving any logical name so that while using this template you can Remember it by name, this is for Contact page Template)
?>
<?php get_header(); //this will call your header files ?>
<?php
//your content goes here
//you can run custom Query here, try running query_posts(); if you want to show posts
?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
2 回答
您可以在Wordpress中创建自定义模板并将其存储在您正在使用的当前主题中
注意: - 此处页眉,页脚和侧边栏将对所有页面保持相同
用于在激活的主题文件夹中创建自定义模板创建文件 . 例如,如果您的自定义模板名称是“home_custom_template” . 在您的文件中编写代码:
1))
这段代码定义为wordpress这是模板 .
2))创建新页面在wordpress中,页面右侧为模板下拉列表 . 你可以在那里找到你的模板 . 因此,请选择您的自定义模板和发布页面 .