Skip to content

Instantly share code, notes, and snippets.

@rushijagani
Created July 26, 2018 08:05
Show Gist options
  • Save rushijagani/9bc90b25db300020e00c9ce8dda0b52f to your computer and use it in GitHub Desktop.
Save rushijagani/9bc90b25db300020e00c9ce8dda0b52f to your computer and use it in GitHub Desktop.
Instead default Astra Post's navigation use Previous Post Link function
<?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' );
}
}
@NIKITAZEML
Copy link

You are Saint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment