<?php /** * The page header displays at the top of all single pages and posts * See framework/page-header.php for all page header related functions. * * @package Total WordPress theme * @subpackage Partials * @version 3.0.0 */ // Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Check if post has terms if so then show next/prev from the same_cat $has_terms = wpex_post_has_terms(get_the_ID()); $same_cat = $has_terms; $same_cat = apply_filters('wpex_next_prev_in_same_term', $same_cat); // Get taxonomy for same_term filter if ($same_cat) { $taxonomy = wpex_get_post_type_cat_tax(); $taxonomy = apply_filters('wpex_next_prev_same_cat_taxonomy', $taxonomy); } else { $taxonomy = ''; } // Exclude terms $excluded_terms = ''; // Previous post link title $prev_post_link_title = '<span class="fa fa-angle-double-left"></span>%title'; $prev_post_link_title = apply_filters('wpex_prev_post_link_title', $prev_post_link_title); // Next post link title
* @since Total 1.6.0 * @version 1.0.0 */ // Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Get post ID global $post; $post_id = $post->ID; // Get current post post type $post_type = get_post_type($post_id); // Set default same category + taxonomy vars $taxonomy = ''; // Check if post has terms if so then show next/prev from the same_cat $has_terms = wpex_post_has_terms($post_id); $same_cat = $has_terms; $same_cat = apply_filters('wpex_prev_post_link_same_cat', $same_cat); // Set the taxonomy for the next/prev when in the same cat if ($post_type == 'post') { $taxonomy = 'category'; } elseif ($post_type == 'portfolio') { $taxonomy = 'portfolio_category'; } elseif ($post_type == 'staff') { $taxonomy = 'staff_category'; } elseif ($post_type == 'testimonials') { $taxonomy = 'testimonials_category'; } // Previous post link title $prev_post_link_title = in_array($post_type, array('testimonials')) ? __('Next', 'wpex') : '%title'; $prev_post_link_title = $prev_post_link_title . '<span class="fa fa-angle-double-right"></span>';