Title: Current Page Filter
Last modified: June 5, 2020

---

# Current Page Filter

 *  [andyt1980](https://wordpress.org/support/users/andyt1980/)
 * (@andyt1980)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/current-page-filter/)
 * Hi,
    Thanks for creating this great plugin.
 * I’d like to style the currently active page number with a different color. To
   do this I thought I could use your currentpage filter:
 * add_filter(‘wp_pagenavi_class_page’, ‘theme_pagination_page_class’);
    function
   theme_pagination_page_class($class_name) { return ‘pagination__current-page’;}
 * However, this is adding the same class to EVERY page number and not just the 
   active one.
 * Any help much appreciated.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * (@gamerz)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/current-page-filter/#post-12946160)
 * See [https://github.com/lesterchan/wp-pagenavi/blob/master/core.php#L70](https://github.com/lesterchan/wp-pagenavi/blob/master/core.php#L70)
 *  Thread Starter [andyt1980](https://wordpress.org/support/users/andyt1980/)
 * (@andyt1980)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/current-page-filter/#post-12947534)
 * Hi,
    I’ve had a look at the code but still need further advice/explanation please.
 * Thank you.
    -  This reply was modified 5 years, 11 months ago by [andyt1980](https://wordpress.org/support/users/andyt1980/).
 *  Plugin Author [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * (@gamerz)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/current-page-filter/#post-12949517)
 * Why not just style by CSS rather than overwriting the PHP if you are not familiar
   with it?
 *     ```
       .wp-pagenavi span.current {
           font-weight: bold;
       }
       ```
   
 *  Thread Starter [andyt1980](https://wordpress.org/support/users/andyt1980/)
 * (@andyt1980)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/current-page-filter/#post-12949845)
 * Thats the problem, I can’t use CSS because there is no ‘current’ class being 
   applied. Maybe it’s because I’m using AJAX to load results?.
    -  This reply was modified 5 years, 11 months ago by [andyt1980](https://wordpress.org/support/users/andyt1980/).
    -  This reply was modified 5 years, 11 months ago by [andyt1980](https://wordpress.org/support/users/andyt1980/).
 *  Plugin Author [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * (@gamerz)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/current-page-filter/#post-12951920)
 * I am not sure what you mean, the current is being applied. You can check the 
   demo here [https://lesterchan.net/wordpress/](https://lesterchan.net/wordpress/)
   and inspect element on “1”. I copied the CSS from there.
 *  Thread Starter [andyt1980](https://wordpress.org/support/users/andyt1980/)
 * (@andyt1980)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/current-page-filter/#post-12956016)
 * I’m using the Search & Filter Pro plugin ( [https://searchandfilter.com/](https://searchandfilter.com/))
   to display posts using a shortcode on a standard wordpress page. The developers
   of the plugin recommended using your plugin to enable page numbered navigation.
 * I’m loading results from the plugin using AJAX as seen on their demo here: [https://demo.searchandfilter.com/movies/](https://demo.searchandfilter.com/movies/)
   and I think thats why the current page class is not being added to my numbers.
 *  Plugin Author [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * (@gamerz)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/current-page-filter/#post-12957619)
 * Then I am not sure. Maybe you can ask them?

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Current Page Filter’ is closed to new replies.

 * ![](https://ps.w.org/wp-pagenavi/assets/icon.svg?rev=977997)
 * [WP-PageNavi](https://wordpress.org/plugins/wp-pagenavi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-pagenavi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-pagenavi/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-pagenavi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-pagenavi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-pagenavi/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/current-page-filter/#post-12957619)
 * Status: not resolved