PHP Code:
/* Next/Previous POST Links (on single post pages)
in next_post_link "next" means newer posts
Available parameters for $location: Top, Middle, Bottom. Default: Top */
function bfa_next_previous_post_links($location = "Top") {
global $bfa_ata, $homeURL;
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="clearfix navigation-'.strtolower($location).'">
<div class="older' . ($bfa_ata['home_single_next_prev'] != '' ?
'-home' : '') . '">';
if ($bfa_ata['next_prev_orientation'] == 'Older Left, Newer Right') {
if($bfa_ata['single_next_prev_same_cat'] == "Yes") {
previous_post_link($bfa_ata['single_next_prev_older'], '%title', TRUE);
} else {
previous_post_link($bfa_ata['single_next_prev_older']);
}
} else {
if($bfa_ata['single_next_prev_same_cat'] == "Yes") {
next_post_link($bfa_ata['single_next_prev_newer'], '%title', TRUE);
} else {
next_post_link($bfa_ata['single_next_prev_newer']);
}
}
echo ' </div>';
if ($bfa_ata['home_single_next_prev'] != '') {
echo '<div class="home"><a href="' . $homeURL . '/">' .
$bfa_ata['home_single_next_prev'] . '</a></div>';
}
echo '<div class="newer';
if ($bfa_ata['home_single_next_prev'] != '') {
echo '-home';
}
echo '"> ';
if ($bfa_ata['next_prev_orientation'] == 'Older Left, Newer Right') {
if($bfa_ata['single_next_prev_same_cat'] == "Yes") {
next_post_link($bfa_ata['single_next_prev_newer'], '%title', TRUE);
} else {
next_post_link($bfa_ata['single_next_prev_newer']);
}
} else {
if($bfa_ata['single_next_prev_same_cat'] == "Yes") {
previous_post_link($bfa_ata['single_next_prev_older'], '%title', TRUE);
} else {
previous_post_link($bfa_ata['single_next_prev_older']);
}
}
echo '</div></div>';
}
}