小编And*_*hew的帖子

Wordpress next_post_link/previous_post_link不属于同一类别

这是我的设置.

single.php中

<?php

    if ( in_category( 'my-category' ) ) {
        include( TEMPLATEPATH.'/single-my-category.php' );
    }
    else {
        include( TEMPLATEPATH.'/single-generic.php' );
    }
?>
Run Code Online (Sandbox Code Playgroud)

单我-category.php

<?php

if ( have_posts() ) : while (have_posts()) : the_post(); ?>

<?php echo the_title(); ?>

<div class="pagination">
    <div class="container">
        <div class="row">
            <div class="next col-xs-6 col-sm-6 col-md-6 col-lg-6">
                <?php next_post_link( '%link', '<img src="' . get_template_directory_uri() . '/img/cs-left.png" /> PREVIOUS', true ); ?>
            </div>

            <div class="previous col-xs-6 col-sm-6 col-md-6 col-lg-6">
                <?php previous_post_link( '%link', 'NEXT <img src="' . get_template_directory_uri() . '/img/cs-right.png" …
Run Code Online (Sandbox Code Playgroud)

php wordpress

9
推荐指数
1
解决办法
2079
查看次数

标签 统计

php ×1

wordpress ×1