Skip to:
Content
Pages
Categories
Search
Top
Bottom

Child Themes, 1.2 & bp-default: No Child Theme Left Behind


  • Mike Pratt
    Participant

    @mikepratt

    @Andy – In the Codex, you state (re bp-default and child theming):

    NOTE: This will be changing for the upcoming BuddyPress 1.2. The overall idea remains exactly the same, however you should be using the new bp-default theme as a parent theme instead. This theme is much simpler to work with.

    Could you elaborate a little more on using bp-default as a parent? The guide as is would imply deactivating bp-default and setting it as “Template: bp-default” in a new child theme.

    But then in bp-default you state:

    ** IMPORTANT – DO NOT COPY THIS THEME **

    If you want to make a custom theme based on this theme, DO NOT copy and edit it. By

    doing this you will make upgrades and maintainence much harder for yourself.

    Instead, please read this codex page on how to build a BuddyPress child theme:

    So what do you suggest as a starting point for child theme dev? Or will bp-default morph into a parent with a skeleton child theme emerging a la how bp-classic was?

Viewing 25 replies - 1 through 25 (of 31 total)
  • You don’t need anything as a starting point for a child theme. Just make a new folder in the themes directory called whatever you want and create a CSS file inside that folder that includes this line inside a comment block at the top:

    Template: bp-default

    Done. You now have a parent (bp-default) and child (whatever you decided to call it). Start adding CSS rules to override the parent… start adding templates to override the parent templates… etc.


    symm2112
    Participant

    @symm2112

    Hmm. I created a child theme for my site using cosmic buddy and THOUGHT i had everything working. I know that it pulls the templates from my child theme and overrides the parent but while trying to figure out why some of the css that I was changing wasn’t working, I realized that all of the css is being pulled from my parent theme. Any idea how I could be pulling templates from the child but css from the parent even though I have css files in the child?


    @mercime
    Keymaster

    @mercime

    @Mike Pratt

    bp-default theme

    – from BP 1.1 up to BP 1.1.3 is the child theme of BP 1.1.3 bp-sn-parent

    – in BP 1.2 bp-default them is now a parent theme used in http://testbp.org that’s why it’s mentioned that you could create child themes from bp-default theme.

    The child theme of BP 1.2 bp-sn-parent is now called bp-classic.

    Reason why you should create a child theme instead of copying 1.2 default theme in trunk is because there’s so many changes going on in code and within themes, and therefor IMHO less stressful and more proactive.


    @mercime
    Keymaster

    @mercime

    @Symm2112 – Cosmic Buddy was never meant to be a parent theme that you would base a child theme on. Brajesh will be updating the whole theme to BP 1.2 code per his post on his site.


    Andy Peatling
    Keymaster

    @apeatling

    The new bp-default is brand new theme with much easier to handle templates, better CSS and simpler JS. Overall it is a big improvement on the original bp-sn-parent/bp-default combination.

    From 1.2 onwards I would recommend using the bp-default as a parent theme.

    It’s quite simple, create a new theme folder in wp-content/themes, create a style.css file and add a:

    Template: bp-default

    to the header of the style.css file. You can then pull in the existing bp-default CSS if you want to use that:

    @import url( ../plugins/buddypress/bp-themes/style.css );

    Then under that line you can begin to make your CSS adjustments. If you want to edit a template file, copy it from bp-default and then paste it into your theme folder.

    That’s really all there is to it. If you do it this way then your theme will get updated when BuddyPress is updated.


    MrMaz
    Participant

    @mrmaz

    This is such a massive improvement. I am pretty excited.


    Mike Pratt
    Participant

    @mikepratt

    @andy Thanks. I had all the style imports except the one you stated


    Mike Pratt
    Participant

    @mikepratt

    @andy in further inspection, I guess you are leaving the entire bp-default folder IN /buddypress/bp-themes instead of moving it into /themes and just leaving it unactivated?

    (gathering this from the url you typed above)


    Mike Pratt
    Participant

    @mikepratt

    @andy just a heads up

    @import url( ../plugins/buddypress/bp-themes/style.css );

    yields

    domain.com/wp-content/themes/plugins/buddypress/bp-themes/style.css

    No… the themes go in /themes… but perhaps if you’re using bp-default as a parent and activating the child… you could leave bp-default anywhere. Not sure. Never tried it. I just put all my themes in “/themes”.

    Anyway. It’s really simple. Just make a new folder inside /themes and put a CSS file in there with the line “Template: bp-default”. Done. You now have a child theme. It doesn’t really do anything until to start adding overriding styles and templates… but you now had a child theme.


    Mike Pratt
    Participant

    @mikepratt

    I left bp-default in the buddypress dir and used it as a parent so I didn’t have to copy it each time I upgraded the trunk. Works fine.


    Mike Pratt
    Participant

    @mikepratt

    @andy All is working fine now. appreciate it. What is your suggested method for removing your custom header functions?

    add_custom_image_header( 'bp_dtheme_header_style', 'bp_dtheme_admin_header_style' );

    I don’t just want to delete them and those are Wp functions you are calling.


    Andy Peatling
    Keymaster

    @apeatling

    Just to clarify – you should not be moving any themes from the BuddyPress directory. From WordPress 2.9 onwards the themes will be automatically detected in the BuddyPress plugin folder. You can simply create a new child theme in wp-content/themes and it will automatically know that the parent is in the BuddyPress plugin folder.

    Mike: Not sure why you want to remove the custom header functions? They simply provide a UI to uploading a custom header image in Appearance > Custom Header.


    Arx Poetica
    Participant

    @arxpoetica

    The new form of parent detection is RAD. I’ve been waiting for this.


    Mike Pratt
    Participant

    @mikepratt

    @andy

    thanks for clarifying pt 1

    re headers: I am building a custom header and need to disable the default header image you provide via that UI. I can’t get rid of the default image and mine is not a matter of uploading a new one. sry for the poor explanation the first time.


    Mike Pratt
    Participant

    @mikepratt

    although I suppose i could just over-ride all the applied styles and go from there

    Hey Mike… I had to use !important to make my custom header override via CSS.

    I had no idea you would keep the themes where they were?! That’s new. Cool!


    modemlooper
    Moderator

    @modemlooper

    This isn’t working anymore. Made a folder in themes and put a style.css file with info below. Activated theme in admin. Site has no styling.

    Template: bp-default

    @import url( http://url.com/wp-content/plugins/buddypress/bp-themes/bp-default/style.css );


    modemlooper
    Moderator

    @modemlooper

    Never mind I’m having a brain fart. I forgot to comment out css header >.<


    Thomas Hoefter
    Participant

    @thoefter

    Does the same also work with the bp-sn-parent theme? Or does this one have to be in the templates folder (it looks like that to me from the style.css)?


    Mike Pratt
    Participant

    @mikepratt

    You can use bp-sn-parent as your parent for those times when you want to use bp-classic. It’s done in the same manner. Go ahead and leave it in the bp-themes folder and reference as Andy instructs here -> https://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/


    r-a-y
    Keymaster

    @r-a-y

    I had an issue trying to activate the bp-default theme on my testbox last night.

    What was the cause? Object cache!

    If you have object cache enabled, delete your /wp-content/cache/ folder before attempting to activate the bp-default theme or child theme of bp-default.


    fostertime
    Participant

    @fostertime

    @Mike

    I am having the same issue with the header image.

    It’s in the functions.php at line 119:

    <style type=”text/css”>

    #header { background-image: url(<?php header_image() ?>); }

    <?php if ( ‘blank’ == get_header_textcolor() ) { ?>

    #header h1, #header #desc { display: none; }

    <?php } else { ?>

    #header h1 a, #desc { color:#<?php header_textcolor() ?>; }

    <?php } ?>

    </style>

    I tried to put my own functions.php file in my theme directory, and changed the style info with my styles, but I get a White Screen whenever I add the functions.php to my theme directory.

    Any ideas?


    Andy Peatling
    Keymaster

    @apeatling

    Change the function names.


    fostertime
    Participant

    @fostertime

    Ok, excellent.

    Now 2 things are occurring.

    1. I renamed all the functions, and now I no longer get the white screen on the public side, but I am now getting a white screen when trying to access /wp-admin/. I updated all the functions in options.php as well and put it in the appropriate _inc directory.

    2. Even with changing functions.php, the blue default theme header is still showing up…

    Sorry if I am missing something.

Viewing 25 replies - 1 through 25 (of 31 total)
  • The topic ‘Child Themes, 1.2 & bp-default: No Child Theme Left Behind’ is closed to new replies.
Skip to toolbar