【发布时间】:2014-03-15 04:01:57
【问题描述】:
我在 Wordpress 中使用默认主题。当我将我的博客页面设置为静态并选择我的Blog List 模板作为页面模板时,它不会使用分页链接导航到其他页面。
URL 显示它已移至第二页,但显示的是同一页面(即不是下 x 个帖子)。
我已经用 Google 搜索过,但没有找到满意的答案。一些帖子建议尝试一些代码。我尝试了他们的建议,但对我没有任何效果,
我的博客列表模板代码如下:
<?php
/*
Template Name: Blog List
*/
?>
<?php get_header(); ?>
<div id="container">
<div class="main<?php if ( is_active_sidebar( 'home-sidebar-small' ) ) : ?> small-sidebar<?php endif; ?>">
<?php if ( is_active_sidebar( 'home-sidebar-small' ) ) : ?>
<div class="sidebar-small">
<?php dynamic_sidebar( 'home-sidebar-small' ); ?>
</div><!-- Sidebar Small -->
<?php endif; ?>
<div class="content">
<div class="warp">
<?php if(bdayh_get_option('article_crumbs') == 1) { ?>
<div class="pp-breadcrumbs bottom10">
<?php bd_breadcrumbs() ?>
</div><!--//end breadcrumbs-->
<hr class="bottom15">
<?php } ?>
<img alt="Amir Anzur" src="http://amiranzur.com/images/Capture.PNG"/>
<br/><br/><br/>
<?php
if(bdayh_get_option('disable_custom_template_blog') == 1) {
query_posts(
array(
'cat' => bdayh_get_option('custom_template_blog_category'), // Enter your ID number
'paged' => get_query_var('paged'),
'post_type' => 'post',
)
);
} else {
query_posts('posts_per_page=3&paged=' . $paged);
}
//rewind_posts();
get_template_part( 'loop-archive', 'category' );
if ($wp_query->max_num_pages > 1) bd_pagenavi();
if (comments_open() && !post_password_required()) {
comments_template('', true);
}
?>
</div>
</div><!-- content -->
</div>
</div>
<!-- container -->
<div id="sidebar">
<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Page Sidebar')){ }else { ?>
<?php get_sidebar(); ?>
<?php } ?>
</div><!-- sidebar /-->
<?php get_footer(); ?
>
【问题讨论】:
标签: php css wordpress pagination