切换到宽版
  • 482阅读
  • 4回复

pagenavi插件如何实现wordpress翻页功能? [复制链接]

上一主题 下一主题
 
只看楼主 倒序阅读 使用道具 0楼 发表于: 2011-08-23

index.php



<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Eleven
*/


get_header(); ?>


        <div id="primary">
            <div id="content" role="main">


            <?php if ( have_posts() ) : ?>


                <?php twentyeleven_content_nav( 'nav-above' ); ?>


                <?php /* Start the Loop */ ?>
                <?php while ( have_posts() ) : the_post(); ?>


                    <?php get_template_part( 'content', get_post_format() ); ?>


                <?php endwhile; ?>


                <?php twentyeleven_content_nav( 'nav-below' ); ?>


            <?php else : ?>


                <article id="post-0" class="post no-results not-found">
                    <header class="entry-header">
                        <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
                    </header><!-- .entry-header -->


                    <div class="entry-content">
                        <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
                        <?php get_search_form(); ?>
                    </div><!-- .entry-content -->
                </article><!-- #post-0 -->


            <?php endif; ?>


            </div><!-- #content -->
        </div><!-- #primary -->


<?php get_sidebar(); ?>
<?php get_footer(); ?>
只看该作者 1楼 发表于: 2011-08-23
谁可以告诉我?这个<php  wp_pagenavi();?>应该插哪里?
tom

只看该作者 2楼 发表于: 2011-08-23
放在文章列表的地方,这个根据不同的主题,文件也不同。

只看该作者 3楼 发表于: 04-08
我也想知道这个问题,一般是插入那个代码文件呢?

只看该作者 4楼 发表于: 04-18
一般放在index.php中,可以看到 类似 上一页 下一页的字样,如:previous_posts_link   next_posts_link 放在这些代码下面就可以了。
快速回复
限100 字节
 
上一个 下一个