Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed WP-PageNavi stylesheets not unloading properly

  • Loading branch information...
commit 4ee4e7ae2709b3ba0cc35ace11edf318764827fb 1 parent 6b550d1
@zyml authored
Showing with 16 additions and 7 deletions.
  1. +0 −3  functions.php
  2. +16 −4 library/styles.php
View
3  functions.php
@@ -79,9 +79,6 @@ function ar2_setup() {
/* Register sidebars */
ar2_add_sidebars();
- /* Header actions */
- remove_action( 'wp_head', 'pagenavi_css' );
-
add_action( 'wp_footer', 'ar2_add_header_js', 100 );
// Editor Style
View
20 library/styles.php
@@ -25,11 +25,13 @@ public function __construct() {
add_action( 'after_setup_theme', array( $this, 'default_fonts' ), 5 );
add_action( 'after_setup_theme', array( $this, 'default_colors' ), 5 );
+ if ( !is_admin() ) {
+ add_action( 'wp_print_styles', array( $this, 'load_styles' ), 1 );
+ add_action( 'wp_print_styles', array( $this, 'remove_styles' ), 100 );
+ }
+
add_action( 'wp_head', array( $this, 'override_styles' ) );
- if ( !is_admin() )
- add_action( 'wp_head', array( $this, 'load_styles' ), 1 );
-
// Theme Options.
add_filter( 'ar2_default_theme_options', array( $this, 'add_default_theme_option' ) );
add_filter( 'ar2_theme_options_sections', array( $this, 'add_theme_option_section' ) );
@@ -418,7 +420,7 @@ public function add_theme_option_fields( $fields ) {
* @since 1.6
*/
public function load_styles() {
-
+
if ( !AR2_ALLOW_CUSTOM_STYLES || (
!ar2_get_theme_option( 'style' ) ||
ar2_get_theme_option( 'style' ) == '_default' ||
@@ -444,6 +446,16 @@ public function load_styles() {
do_action( 'ar2_load_styles' );
}
+
+ /**
+ * Removes any unwanted styles.
+ * @since 1.6
+ */
+ public function remove_styles() {
+
+ wp_deregister_style( 'wp-pagenavi' );
+
+ }
/**
* Overrides certain styles from the theme.
Please sign in to comment.
Something went wrong with that request. Please try again.