Atahualpa Post Navigation

Altahualpa ‘next’ and ‘previous’ post navigation entries are global across all site postings.  When we are looking at postings by category we would like to our ‘next’ and ‘previous’ navigation links to show only postings within the category.

Fortunately, the WordPress functions next_post_link and previous_post_link provide an optional parameter to restrict links to categories.

Note: This functionality is now configurable in Atahualpa version 3.6.4


functions/bfa_next_previous_links.php

Modify the identified lines in function bfa_next_previous_post_links to be as shown:

function bfa_next_previous_post_links($location = "Top") {

global $bfa_ata;

	if ( is_single() AND strpos($bfa_ata['location_single_next_prev'],$location) !== FALSE AND

    // don't display on WP Email pages
    intval(get_query_var('email')) != 1 )  {

		echo '<div class="navigation-'.strtolower($location).'">
		<div class="older' . ($bfa_ata['home_single_next_prev'] != '' ?
        '-home' : '') . '">';

		$bfa_ata['next_prev_orientation'] == 'Older Left, Newer Right' ?
		previous_post_link('« %link', '%title', TRUE) :
		next_post_link('%link »', '%title', TRUE);

		echo '  </div>' . ($bfa_ata['home_single_next_prev'] != '' ?
        '<div class="home"><a href="' . $bfa_ata['get_option_home'] . '/">' .
        $bfa_ata['home_single_next_prev'] . '</a></div>' : '') .
		'<div class="newer' . ($bfa_ata['home_single_next_prev'] != '' ?
        '-home' : '') . '">  ';

		$bfa_ata['next_prev_orientation'] == 'Older Left, Newer Right' ?
		next_post_link('%link »', '%title', TRUE) :
		previous_post_link('« %link', '%title', TRUE);

		echo '</div><div class="clearboth"></div></div>';

	}
}