Skip to content

Instantly share code, notes, and snippets.

@raphaelkross
Created April 28, 2017 18:01
Show Gist options
  • Select an option

  • Save raphaelkross/cb84bc6a9355799dea974ba6233c8a19 to your computer and use it in GitHub Desktop.

Select an option

Save raphaelkross/cb84bc6a9355799dea974ba6233c8a19 to your computer and use it in GitHub Desktop.

Revisions

  1. raphaelkross created this gist Apr 28, 2017.
    29 changes: 29 additions & 0 deletions genesis-nav.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    <?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' );
    }