如何使用wordpress页眉和页脚创建静态页面?

时间:2012-02-01 09:52:28

标签: wordpress

如何使用wordpress页眉和页脚创建静态页面?我不是在谈论静态主页只是一个只使用wordpress页眉和页脚的静态页面。

2 个答案:

答案 0 :(得分:4)

模板!

在主题文件夹中创建一个名为any的空白.php文件,在顶部输入以下内容:

<?php
/**
* Template Name: My very own template!
* Description: Look pah! I made a template!
*/ 
get_header();
?>
Whatevercontent you want the page to have, could get content from the wp_editor like this:
<?php the_content(); ?>
<?php get_footer(); ?>

在管理区域中创建一个新页面,检查右边的“页面属性”,在那里你会找到一个“模板”下拉列表,在这里选择你自己的模板“我自己的模板!”在这种情况下会被调用。

现在该页面将在模板文件中加载php代码。

答案 1 :(得分:0)