【发布时间】:2013-03-27 14:48:45
【问题描述】:
我现在正在开发一个 Wordpress 模板。我有一个静态索引页面。对于我的博客文章,我使用了一个名为 Blog 的自定义模板。但是当我在这个Blog 模板下创建一个页面并尝试查看该页面时;它不显示博客页面,而是显示404.php
我正在使用这些文件:
index.php //static index page
blog.php //blog page under Blog template
404.php
这是我的网站http://ratcat.bugs3.com/samata/ 这是无法正常工作的博客页面http://ratcat.bugs3.com/samata/blog-6
更多帮助,这里是我的 blog.php 主要代码段:
<div class="single_post">
<?php
// The Query
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("paged=$page");
// The Loop
if(have_posts()) :
while ( have_posts() ) : the_post();
?>
<table>
<tr>
<td class="left_date">
<h1><?php the_time('d') ?></h1>
<p><?php the_time('M') ?></p>
<span class="year"><p><?php the_time('Y') ?></p></span>
</td>
<td>
<a href="<?php the_permalink(); ?>" ><h2><?php the_title(); ?></h2></a>
<div class="author_tag">
<span class="author">By: <?php the_author_posts_link(); ?></span>
<span class="tag"><?php the_tags(); ?></span>
</div>
<div class="post">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('post-image', array('class' => 'post-thumb')); ?></a>
<p><?php the_excerpt(); ?></p>
<div class="read_comment">
<a href="<?php the_permalink(); ?>" title="Full post"><span class="read">Read more</span></a>
<span class="comment"><?php comments_popup_link('No Comment', '1 Comment', '% Comments'); ?></span>
</div>
</div>
</td>
</tr>
</table>
<div class="clear"></div>
<div class="gap"></div>
<?php
endwhile; ?>
<table class="nav_post">
<tr>
<td><div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">«</span> Previous posts') ); ?></div></td>
<td><div class="nav-next"><?php previous_posts_link( __( 'Next posts <span class="meta-nav">»</span>') ); ?></div></td>
</tr>
</table>
<?php
endif;
// Reset Query
wp_reset_query();
?>
</div>
【问题讨论】:
-
好的,首先检查是否是导致我的永久链接结构将您的永久链接更改为默认值,然后查看是否发生任何事情
-
你能粘贴你的永久链接设置并检查重写模块是否启用。
-
什么也没发生。同样的404问题。有一件事,当我在它下创建一个页面时,我还有一个名为 Personal Journey 的自定义模板。该页面工作正常。 @anstrangel0ver
-
检查下答案
标签: wordpress http-status-code-404 blogs