Archived topic
WP Paginate or BWS Pagination
14 replies · Started by Damiaan van Vliet on February 2, 2018
Hi great support team,
I try to implement a plug-in like WP Paginate or BWS Pagination because wp-pagenavi is not supported anymore.
I tried several options to get one of these plug-ins to work but no luck.
E.g. adding the codes to the functions.php or single.php or in wp hooks.
Do you have tips or ideas for this?
I can give more details but maybe there is something general to tell about implementing those plug-ins because they globally work on the same way.
Thanks!
Oh with wp-pagenavi I normally have this:
PHP
add_action('generate_paging_navigation','generate_pagenavi_integration');
function generate_pagenavi_integration()
{
wp_pagenavi();
}
CSS
.page-numbers {
display: none;
}
Hi there,
Can you provide the installation instruction from the plugin you are trying to implement?
Thanks!
Of course Leo. For example the plug-in WP-paginate.
I have to replace code within index.php (child theme) but the code they suggest I don't see.
Code with the_posts_pagination; for more info see:
wp paginate info
Thanks!
You can use this hook:
add_action( 'generate_paging_navigation', 'tu_add_wp_paginate' );
function tu_add_wp_pagination() {
if ( function_exists( 'wp_paginate' ) ) {
wp_paginate();
}
}
Then add this CSS:
.nav-previous + .nav-links {
display: none;
}
Thanks Tom for reply. I tried it but it is not working, or I am blind (which is sometimes possible) ;-)
I thought it is visible for example on the News page or the seperate blog posts.
Is there a specific page on your site I can check out to see why it's not showing up?
Hi Tom,
I noticed I had too little posts so now it is visible on the blog page :)
test site news page
But the pagination is not on the right position.
Also, I thought it should be visible on a single news page like this one:
test site blogpost
But maybe I have to ask the developer of the plug-in?
Thanks!
You used this hook?: generate_paging_navigation
The HTML seems to be appearing outside of that element.
Hi Tom,
I placed the following code on GP Hooks, Before Header (did not know exactly which hook I need to choose)
<script>
add_action( 'generate_paging_navigation', 'tu_add_wp_paginate' );
function tu_add_wp_pagination() {
if ( function_exists( 'wp_paginate' ) ) {
wp_paginate();
}
}
</script>
Instead of using hooks, use one of these methods: https://docs.generatepress.com/article/adding-php/
Hi Tom,
Tried that also. Added the following to functions.php on my child theme:
add_action( 'generate_paging_navigation', 'tu_add_wp_paginate' );
function tu_add_wp_pagination() {
if ( function_exists( 'wp_paginate' ) ) {
wp_paginate();
}
}
Also disabled all plug-ins except GP Premium and WP Pagination and still the same.
Odd.
Strange.. Let's do this then:
.generate-columns-container article + .navigation {
-webkit-box-flex: 1;
-webkit-flex: 1 1 100%;
-ms-flex: 1 1 100%;
flex: 1 1 100%;
clear: both;
text-align: center;
}
Yes, working!! You're the man :)
I also addded:
.generate-columns-container .paging-navigation {
display: none;
}
Because the old navigation also was visible.
But solved, thanks Tom!
Glad I could help! :)