【发布时间】:2012-07-17 11:22:02
【问题描述】:
我按照本教程获取页面特定模板 -- http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates
通过 wordpress 管理面板创建一个页面 - Blog Page URL like -- http://localhost/wordpress/blog-page/ 并从管理面板本身将模板设置为我的模板“Swapnesh”。
将我的特定页面模板创建为page-blog-page.php,其中包含以下代码--
<?php
/*
Template Name: Swapnesh
*/
get_header(); ?>
<div id="primary">
<div id="contentabc" style="border:7px solid red;">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
<?php get_sidebar(); ?>
</div><!-- #primary -->
<?php get_footer(); ?>
现在当我导航到http://mysite/wordpress/blog-page/ 时,我没有得到那个边界以便我可以继续前进,让我知道我做错了什么。
注意--在“Reading Settings”下,当我取消选择此选项时,mu 帖子页面选择为“博客页面”,它向我显示red border,但随后没有帖子:(
【问题讨论】:
标签: php wordpress templates wordpress-theming