Created
July 26, 2018 08:05
-
-
Save rushijagani/9bc90b25db300020e00c9ce8dda0b52f to your computer and use it in GitHub Desktop.
Instead default Astra Post's navigation use Previous Post Link function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Remove default Astra Post's Pagination. | |
remove_action( 'astra_entry_after', 'astra_single_post_navigation_markup' ); | |
// Add Previous Post| Next Post Link for Post's Pagination. | |
add_action( 'astra_entry_after', 'astra_single_post_custom_navigation_markup' ); | |
function astra_single_post_custom_navigation_markup() { | |
$single_post_navigation_enabled = apply_filters( 'astra_single_post_navigation_enabled', true ); | |
if ( is_single() && $single_post_navigation_enabled ) { | |
previous_post_link( '<div class="nav-previous"><span class="prev" title="' . esc_attr__( 'Previous', 'astra' ) . '">%link</span></div>', '%title' ); | |
next_post_link( '<div class="nav-next"><span class="next" title="' . esc_attr__( 'Next', 'astra' ) . '">%link</span></div>', '%title' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are Saint