Skip to:
Content
Pages
Categories
Search
Top
Bottom

Setting up Buddypress with a child theme – customizing themes

  • @mmqg

    Participant

    I have a Buddypress network site using the latest version of the basic Buddypress Default theme. I also have uploaded and installed the latest TwentyTen child theme. IThe way it’s set up now, the main site uses the Default theme, and the users have the TwentyTen theme for their blogs.

    I need to edit the main template to make the header section higher. I read somewhere that if I edit the main theme template, when there are updates to the theme, I’ll lose that customization. Is that correct? And if so, what’s the best way to handle that?

    A favour please – I am not a techo, and I can’t write code really. I’m great however at following instructions that are step-by-step from beginning to end. Otherwise I can get lost and not know what to do, or worse, do what I think you mean, and end up messing things up, so please be kind.

    Thanks very much,
    Helene

Viewing 12 replies - 1 through 12 (of 12 total)
  • @jonacb

    Participant

    Try https://codex.wordpress.org/Child_Themes

    I created my own child theme for Buddypress following those instructions.

    @djpaul

    Keymaster

    Helene
    A child theme lives in its own directory, and inherits any files not presenting the child theme, from its parent theme. So what you would do is create a child theme of BP Default and copy into your child theme, BP Default’s header.php (for example – what you want may be on another page) and customise it. You’ll only have to worry about updating it in the future if BP Default itself is updated (probably not for a couple of months, at least).

    @helpy

    Participant

    Does child-theming of the BP Default theme (which resides in wp-content/plugins/buddypress/bp-themes) will work if I put the child theme in wp-content/themes?

    Because if I update buddypress plugin with the wordpress update function … all templates in wp-content/plugins/buddypress/bp-themes will be deleted before the new version will bei installed!

    cu, guido

    @djpaul

    Keymaster

    Yep, of course it will.

    @mmqg

    Participant

    So if it will delete all the files during an update, then what’s the point of customizing? I don’t understand that. And won’t the same thing happen then when I customize the child theme and later apply the update to it?

    @modemlooper

    Moderator

    Child themes do not get deleted, only the files inside wp-content/plugins/buddpress/bp-theme

    This is why you never modify those files. if you want to change those files, then you copy them to your child theme folder preserving the folder structure.

    If you want to change the header then you copy over the header.php to child them folder and BP will use this file instead of the one in the plugins folder. No fear of it getting wiped out on upgrades.

    @mmqg

    Participant

    @Modemlooper so if I’ve installed the TwentyTen child theme, should I also have that as the main theme? I currently have the Default BP theme as my main theme, and the TwentyTen as child. Is that not workable? Or do you mean that I need to create a new child theme based on the Default theme as well as keeping the TwentyTen child theme?

    @mmqg

    Participant

    Now, I’ve just upgraded to WP 3.0.1, and updated the network too. I wonder if I should at this point install the Twenty Ten 1.1 theme as the main theme, given that TwentyTen CP is in use too. What do you think? That might handle my header image issue, and perhaps make things run more smoothly.

    @modemlooper

    Moderator

    If you are using a child theme then you do not need to worry about the default theme unless you ned to modify a file. At that point you copy the file to your child theme.

    The regular WP twenty ten them will not work with BP out of the box that is why there is a BP version.

    @mmqg

    Participant

    when you say “if you are using a child theme” do you mean do I have cp-twentyten as the current theme in admin/appearance/themes? No, I don’t. I have the current theme BuddyPress Default 1.2.5.2, and I have the child theme uploaded to wp-content/themes/

    @hnla

    Participant

    When you refer to a child theme it refers to the ability to create a new blank folder within the ‘theme’ folder this would be considered a ‘Child theme’ if it simply had a stylesheet residing in it’s root /top level that stated it was using the files from a particular parent theme, what then happens is having selected this theme – which now would appear in your dashboard themes page, – WP examines the stylesheet information at the top of the file and finds that it instructs WP to look for files in a particular theme as being the main theme files to use; however the clever trick is that WP first knows that it must look in your child theme for necessary files FIRST! and if they are not found THEN look for the necessary file in the stated parent theme, thus you do not have to have any files in your child theme as WP will use the parent files, but you can add new CSS rulesets to the stylesheet living in the child theme and these will be read and acted on (that stylesheet references the parent CSS stylesheet files through the @import rule first and then reads on for any additional rules you have added below the @import calls)

    If you do not want to make any changes to BP-Default theme then you simply activate that theme as seen in the theme page in the dashboard. When members create a blog then those blogs should use the twentyten theme or whatever other themes you choose to download and make available (Note that you decide what themes are available to members via the ‘Super Admin >Themes’ page only the themes that you select ‘yes’ to are available to member blogs so to avoid them attempting to use the BP-Default on user blogs you ensure BP themes are not selected)

    If you decide that you do need to make changes to BP-Default theme then you would create a folder under ‘Themes’ name it ? ‘my-bp-default’
    to the folder you add the requisite stylesheet and now you can move files as required from bp-Default original folder to your new folder and edit them as you wish, or simply create new rulesets to style elements which you place in the new stylesheet file. BP/WP now looks at your new child theme for any files that it must use in preference to the same versions that might reside in the original theme folder.

    Apologies if the above covers ground you already understand.

    @mmqg

    Participant

    No no no, that’s fabulous, many thanks @hnla! I understand the logic of it all now. I’ll get to work on setting all that up now, and see how I go.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Setting up Buddypress with a child theme – customizing themes’ is closed to new replies.
Skip to toolbar