Site logo

Archived topic

how to override a page

6 replies · Started by sincos on May 22, 2018

Viewing posts 1–7 of 7

Hi,

I would like to know if it's possible to override that template page (in the link) because I need to override the theme pagination to fit with the plugin. The FacetWP support told us that we had to modify it...

Thanks!

Hi there,

Not quite sure if I understand.

Which element(s) are you trying to overwrite and what do you need to do with it?

Let me know.

The plugin FacetWP support told us to edit the theme page because the pagination is not working well...

Here’s their answer :

in your theme template with <?php echo facetwp_display( 'pager' ); ?>

You may need to check with the theme's support on how to override the theme pagination in your child theme.

Thanks.

So you want to replace the default pagination with that function? It will work everywhere on the site where pagination exists?

Yes. The plugin support told me that is probably possible to add a condition to apply that pagination to only this page...

I wonder why they don't just filter the core pagination to add their functionality.

You could try this:

add_action( 'generate_paging_navigation', 'tu_custom_pagination' );
function tu_custom_pagination() {
    if ( function_exists( 'facetwp_display' ) ) {
        echo facetwp_display( 'pager' ); 
    }
}

Adding PHP: https://docs.generatepress.com/article/adding-php/

just tried this - although it shows the facetwp pagination interestingly GP shows 60 pages to go whereas facet shows 68 pages in my case - I got 418 post at 7 pages - 60 seems to be correct.

This archived topic is closed to new replies.