【发布时间】:2015-03-13 03:05:10
【问题描述】:
我不知道我做错了什么...我已经为我的博客构建了一个主题,当我在此基础上构建时,它可以在我的本地服务器上运行(使用 mamp)。从那以后,我将我的网站移到了网上,但现在博客的模板没有应用到博客页面。 Here is the blog。我已经签入了指向该模板文件的管理员。它确实指向正确的文件,但它只是没有得到应用。我还尝试了这个问题中给出的建议:Applying templates to pages loaded from Wordpress Loop 并打开了 wp_debug。它没有向我返回任何错误。我真的迷路了。下面是模板文件中的代码。如果您查看我博客的源代码,您会看到它们不匹配,因为没有应用此模板文件。有谁知道是什么导致模板被应用?
模板文件中的代码:
<?php
/*
Template Name: Blog Template
*/
get_header();
?>
<span>Is this thing on?</span>
<div id="blog_content">
<?php
query_posts('post_type=post');
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<div class="blog_post">
<div class="post_wrap">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<div class="entry_date"><?php the_time('F jS, Y') ?></div>
<?php
the_content();
?>
<div class ="post_foot">
<div class="comment_links">
<a href="<?php the_permalink(); ?>">View Comments / Leave a Comment</a>
</div>
<div class="social_shares">
Share this article with your frenz!
<ul class="share_links">
<li><a class="fb_share_link" target="_blank" href="http://www.facebook.com/sharer.php?u=<?php esc_url(the_permalink());?>"></a></li>
<li><a class="twitter_share_link" target="_blank" href="#"></a></li>
<li><a class="google_share_link" target="_blank" href="#"></a></li>
<li><a class="reddit_share_link" target="_blank" href="#"></a></li>
<li><a class="pin_share_link" target="_blank" href="#"></a></li>
<li><a class="linkedin_share_link" target="_blank" href="#"></a></li>
<li><a class="mail_share_link" target="_blank" href="#"></a></li>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<?php
}
}
?>
<div class="nav-previous alignleft"><?php next_posts_link('Older posts'); ?></div>
<div class="nav-next alignright"><?php previous_posts_link('Newer posts'); ?></div>
</div>
<div id="blog_sidebar">
<div class="sidebar_block">
<div class="sidebar_wrap">
<?php get_sidebar(); ?>
</div>
</div>
<div class="sidebar_block">
<div class="sidebar_wrap">
Hello! This is a test to make sure adding another block here won't hurt anything but let's be honest it probably will break the internet.
</div>
</div>
</div>
【问题讨论】:
-
更新:不管我在后台修改什么模板文件,都没有改变!
标签: html wordpress templates wordpress-theming