Skip to:
Content
Pages
Categories
Search
Top
Bottom

Theme Development on Trunk

  • I’m having a hard time making a child theme on the bp-default parent theme in the trunk… Can anyone help me out here?

    Yes, I followed the instructions on the codex.buddypress.org page for child themes EXACTLY. It seems like the default.css?1.3-bleedingedge is taking precedence over any files I put into my child theme; however, my child theme’s css files ARE showing up when I check via firebug…

    Thoughts? Suggestions? Instructions?

    Thanks!

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

  • @mercime
    Keymaster

    @mercime

    In the meantime, as of BP 1.3 trunk-4414

    1. open up https://buddypress.trac.wordpress.org/browser/trunk/bp-themes/bp-default/functions.php

    2. comment out line # 163 and lines #170 to #175

    3. add to your child theme’s stylesheet
    `@ import url( ../../plugins/buddypress/bp-themes/bp-default/_inc/css/reset.css );
    @ import url( ../../plugins/buddypress/bp-themes/bp-default/_inc/css/default.css );
    @ import url( ../../plugins/buddypress/bp-themes/bp-default/_inc/css/adminbar.css );`
    delete space between `@` and `import`

    Never edit core!

    If you want to totally stop bp-default parent loading its default.css etc, use this in your child’s functions.php:

    `
    remove_action( ‘wp_print_styles’, ‘bp_dtheme_enqueue_styles’, 11 );
    `

    Hmm slightly frustrated to find this enqueue change as had been unaware and working to what I thought was a relatively current bleeding edge on the test install for a theme.
    Have had to try and work out how things are now pulling together and get rid of the styles as they crashed my layout.

    remove_action doesn’t work and I had to track down the means of deregistering enqueued styles (please correct me if remove_action does work?)

    This will de-register the styles (adminbar works differently and checks for a file in theme folder so can be overridden if you place copy of file in _inc/css/ in your child theme.

    `
    add_action( ‘wp_print_styles’, ‘deregister_bp_dtheme_styles’, 100 );
    function deregister_bp_dtheme_styles() {
    wp_deregister_style( ‘bp-default-reset’, ‘bp-default-main’);
    }
    `

    It feels a little confusing BP’s approach to these style file enqueing and adminbar, not sure it’s 100% right?


    @mikey3d
    Participant

    @mikey3d

    How do I eliminate CSSs and JavaScripts so I can control what I want only one CSS and JavaScript?

    ? Do you mean what has been discussed in the posts in this thread?

    Have a read of the WP codex, look at functions such as register_style, enqueue_style, enqueue_scripts and associated functions


    @mikey3d
    Participant

    @mikey3d

    "? Do you mean what has been discussed in the posts in this thread?"

    Either, it’s relevant.

    "Have a read of the WP codex, look at functions such as register_style, enqueue_style, enqueue_scripts and associated functions"

    Nah, just found this helpful How to disable scripts and styles.

    Thanks @hnla

    :) still at a loss as to why you asked or what you asked in the first place but as long as you’ve found what you need alls well


    @mercime
    Keymaster

    @mercime

    == Never edit core! ==
    Of course you’re right, DJPaul.
    *mercime smacks palm on forehead*

    It should. Where are you calling it? Probably you are removing before it’s being added.

    @djpaul
    Where are you calling it? from my desk, calling loudly towards the monitor but it doesn’t work.

    Can’t be removing it before it’s been called can it? calling it in functions.php child theme and cycled through various priorities from your ’11’ down and up as it’s simply a remove_action() I expected it to work without issue, what am I missing then about functions.php loading order? However I prefer the approach to de-registering rather than leaving registered but simply not adding.

    The trick would be to find an action that happens after functions.php is loaded but before wp_print_style() happens. But, I’ve just remembered, as you’re talking about trunk, the bp_dtheme_enqueue_styles() is a pluggable function.

    `function bp_dtheme_enqueue_styles() {}`

    should stop it

    Ah knew there was a reason grr

    Personally speaking I’ll generally be talking about trunk as I’m concentrating on working with =>1.3


    @mercime
    Keymaster

    @mercime

    @hnla this worked for me in child theme
    `add_action( ‘wp_print_styles’, ‘our_deregister_bp_dtheme_styles’, 100 );
    function our_deregister_bp_dtheme_styles() {
    wp_deregister_style( ‘bp-default-reset’ );
    wp_deregister_style( ‘bp-default-main’ );
    }`

    @mercime isn’t that what I wrote a few posts up :) although my version was more concise :P

    However since that was written there were other changes made to BP styles so I had to revise that to simply ‘bp-default-main’ as resets ‘spit’ were moved into main, so removing or de-registering reset.css ‘spit’ is no longer needed in this respect.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Theme Development on Trunk’ is closed to new replies.
Skip to toolbar