Skip to content

Instantly share code, notes, and snippets.

@raphaelkross
Created April 28, 2017 18:01
Show Gist options
  • Save raphaelkross/cb84bc6a9355799dea974ba6233c8a19 to your computer and use it in GitHub Desktop.
Save raphaelkross/cb84bc6a9355799dea974ba6233c8a19 to your computer and use it in GitHub Desktop.
Genesis Pagination FacetWP
<?php
//* Do NOT include the opening php tag
add_action( 'loop_end', 'custom_replace_genesis_pagination' );
/**
* Replace Genesis' Pagination with FacetWP's.
*/
function custom_replace_genesis_pagination() {
if ( ! ( is_home() || is_archive() || is_search() ) ) {
return;
}
remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );
add_action( 'genesis_after_endwhile', 'custom_posts_nav' );
}
function custom_posts_nav() {
if ( ! function_exists( 'facetwp_display' ) ) {
return;
}
// Display pagination
echo facetwp_display( 'pager' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment