Archived topic
Blog paging - Pagenavi styles?
9 replies · Started by Tobias Hjorth on October 14, 2014
Hi
Thanks again for a great theme.
I have a question for the page navigation when Masonry is disabled. I can't figure where I can replace the standard paging (1 2 … 75 Next →) with the easier pagenavi plugin. Can you give a hint to where I should replace the code?
Thanks again
Tobias Hjorth
http://www.tobiashjorth.com
Hi Tobias,
I actually just included a new hook in the theme that will allow you to hide the current page navigation and add your own (pagenavi).
Hoping to have the new version out this week, and will revisit this thread once that happens with the code you can use.
Thanks!
You're the man. Thanks for your Work and this awesome theme
Alright, with the new version out, you can do the following:
First, create a new plugin using "Pluginception": https://wordpress.org/plugins/pluginception/
In your plugin, add this code:
https://gist.github.com/generatepress/dba8ffb102ece3152237
Then, add this CSS (in your style.css or Custom CSS plugin) to hide the default navigation:
.page-numbers {
display: none;
}
Hi again Tom
Thank you so much for your effort.
A bit of a coding newbie here, but the plugin gives me an fatal error. I'm sure I'm doing it wrong:
<?php
/*
Plugin Name: Generatepagenavi
Plugin URI:
Description:
Version:
Author:
Author URI:
License:
License URI:
*/
add_action('generate_paging_navigation','generate_pagenavi_integration');
function generate_pagenavi_integration()
{
wp_pagenavi();
}
.page-numbers {
display: none;
}
The .page-numbers part should go in your CSS, as it's not PHP.
If you remove that and add it to your CSS, you should be good to go.
Worked like a charm. Thanks again Tom for your support! :)
Glad I could help :)
Hello,
I have a question for the page navigation. Where I can replace the standard paging (1 2 … 75 Next →) with the easier pagenavi plugin?
Hi there,
You can add this PHP:
add_action('generate_paging_navigation','generate_pagenavi_integration');
function generate_pagenavi_integration()
{
wp_pagenavi();
}
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
Then this CSS:
.page-numbers {
display: none;
}
Adding CSS: https://generatepress.com/knowledgebase/adding-css/