1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
$next_post = get_next_post( true,array(7,6), 'category');
if(isset($next_post)) { $cat_next_post = get_the_category($next_post ->ID); }
if(isset($cat_next_post)) { $next_member_ID = $cat_next_post[1]->term_id; }
if ($cat_next_post[0]->term_id == $my_category_id) {
if (!empty( $next_post )):
if ($next_member_ID == $the_cat_ID) {
$title = apply_filters('the_title', $next_post->post_title);?>
<li class="txt-left right focused">
<?php } else {
$nameOfDifferentCat = $cat_next_post[1]->cat_name;
$title = apply_filters('the_title', $nameOfDifferentCat);
?>
<li class="txt-left right">
<?php } ?>
<a href="<?php echo get_permalink( $next_post->ID ); ?>">
<?php
echo $title;
?></a>
</li>
<?php endif; }?>
<?php
$prev_post = get_previous_post( true,array(7,6), 'category');
// var_dump($prev_post);
if(isset($prev_post)) { $cat_prev_post = get_the_category($prev_post ->ID);}
if(isset($cat_prev_post)) { $prev_member_ID = $cat_prev_post[1]->term_id; }
if ($cat_prev_post[0]->term_id == $my_category_id) {
if (!empty( $prev_post )):
if ($prev_member_ID == $the_cat_ID) {
$title = apply_filters('the_title', $prev_post->post_title);?>
<li class="txt-right focused">
<?php } else {
$nameOfDifferentCat = $cat_prev_post[1]->cat_name;
$title = apply_filters('the_title', $nameOfDifferentCat);
?>
<li class="txt-right">
<?php } ?>
<a href="<?php echo get_permalink( $prev_post->ID ); ?>"><?php
echo $title;
?></a></li>
<?php endif;} ?> |
Partager