Skip to:
Content
Pages
Categories
Search
Top
Bottom

Updating issue


  • solserpiente
    Participant

    @solserpiente

    When I upgrading to version 2.2 of Buddypress some of my theme css files are not loaded to head in single profile member page. It works fine in groups, member loop, activity and elsewhere.

    If I downgrade to version 2.1 works again perfectly.

    I have spent several hours looking for this irritant bug, but I can not find it.

    Any help?

    Thanks in advance

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

  • r-a-y
    Keymaster

    @r-a-y

    You didn’t mention how you are adding your CSS.

    What code are you using to enqueue your CSS?


    solserpiente
    Participant

    @solserpiente

    Hi
    Sorry, you are right.

    I enqueue my styles from my theme function.php file, in this way:
    wp_enqueue_style( 'showcase', get_bloginfo( 'stylesheet_url' ) );

    If I use this code in header.php it works:

    if ((bp_is_user()) || (bp_current_component('groups')) ){
    <link rel='stylesheet' id='showcase-css'  href='http://mysite.com/theme/style.css?ver=4.1' type='text/css' media='all' />
    }

    But if I use this in functions.php not works:

    if ((bp_is_user()) || (bp_current_component('groups')) ){
    wp_enqueue_style( 'showcase', get_bloginfo( 'stylesheet_url' ) );
    }

    Obviously, I have found the solution with code in header.php, but I am curious to know what has changed in the buddypress code for this to happen.

    Thank you for your attention

    Best regards


    r-a-y
    Keymaster

    @r-a-y

    if ((bp_is_user()) || (bp_current_component('groups')) ){ looks wrong.

    Try:

    if ( bp_is_user() || bp_is_current_component( 'groups' ) ) {

    Also are you running your enqueue styles on the 'wp_enqueue_scripts' action?


    solserpiente
    Participant

    @solserpiente

    No, it does not work.
    Yes, I am running several scripts in this way:
    wp_enqueue_script( 'jquery', get_template_directory_uri() . "/js/jquery-1.4.4.min.js", null, '1.4.4', false );


    r-a-y
    Keymaster

    @r-a-y

    You’re doing something wrong because this is working for me:

    function my_enqueue_styles() {
    	if ( ! function_exists( 'is_buddypress' ) ) {
    		return;
    	}
    
    	if ( bp_is_user() || bp_is_current_component( 'groups' ) ) {
    		wp_enqueue_style( 'my-style', get_template_directory_uri() . '/test.css' );
    	}
    }
    add_action( 'wp_enqueue_scripts', 'my_enqueue_styles' );

    Stylesheet is loaded on member profile pages and group pages only.


    solserpiente
    Participant

    @solserpiente

    there was a conflict with two old functions in functions.php file

    add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
    function my_deregister_styles() {
    	if ( is_page('Inscripciones') ) {
    	wp_deregister_style( 'showcase' );
    	wp_deregister_style( 'font-titillium' );
    	wp_deregister_style( 'font-leaguegothic' );
    	wp_deregister_style( 'ie6' );		
    	wp_deregister_style( 'ie7' );
    	}
    }
    
    add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
    function my_deregister_javascript() {
       if ( is_page('Inscripciones') ) {
    	wp_deregister_script( 'jquery' );
    	
    	wp_deregister_script( 'hoverIntent' );
    	wp_deregister_script( 'superfish' );
    	wp_deregister_script( 'md5' );
    	wp_deregister_script( 'prettyjs' );
    	wp_deregister_script( 'jquery.tools' );
    	
    	
         }
    }

    Thank you very much again

    Best regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Updating issue’ is closed to new replies.
Skip to toolbar