这是我的设置.
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)