Skip to:
Content
Pages
Categories
Search
Top
Bottom

Trying to understand Child Themes vs. Plugins

  • @barchiola

    Participant

    I’ve been posting a lot today as I’ve been trying to make it possible to make BuddyPress style edits. I’m following the Child Theme directions and using google to try and fill in the blanks but I’m wondering if I’m not wasting my time reading about Child Themes.
    We have a Theme, it’s ClassiPress and what I’m doing seems to want to override the ClassiPress theme.
    Can someone maybe explain the difference between making a Child BuddyPress Theme and just making it possible to modify select parts of the BuddyPress Plugin?
    Thanks,
    Bart

Viewing 15 replies - 1 through 15 (of 15 total)
  • @1a-spielwiese

    Participant

    @barchiola:

    You have to insert just that changes (i.e.: new style-definitions), which you want to make.

    E.g.: I intended to change the background color of my BuddyPress-menus. Therefore I inserted into my style.css, which is placed within my child-theme-folder:

    #buddypress div.item-list-tabs {
        background: #008080
    }
    
    #buddypress div.item-list-tabs#subnav ul li {
    	background: #DCDCDC
    }

    Doing that, the original background-color transparent is substituted – in the first case – by #008080 and in the second case by #DCDCDC.

    The result you can see there:

    http://1a-spielwiese.de/neuigkeiten/

    In the corresponding way I inserted the #008080-borders.

    @barchiola

    Participant

    really? that’s it? only the stuff that you want to change?

    i’ll have to give that a try and thank you very much for the help!

    @1a-spielwiese

    Participant

    only the stuff that you want to change?

    Yes, indeed.

    @barchiola

    Participant

    is the child theme folder in the wp-content/themes/ folder as it’s described in the codex entry?
    is there anything else to do as far as pointing things in the right direction other than building the new style.css file in the child directory?

    i’m trying to modify the various boxes and windows for the buddypress features so to start I did this but when I save it and then reload the page nothing is happening. Thank you.

    /*
    Theme Name: BuddyPress_GSN
    Theme URI: http://www.giantscalenews.com/wp-content/themes/Buddypress_Child_GSN/
    Description: GSN BuddyPress Child Theme
    Version: 2.1.1
    Author: Bart
    Author URI: http://www.giantscalenews.com
    Template: buddypress
    Tags: buddypress
    */

    div.item-list-tabs ul li.current a,
    div.item-list-tabs ul li.selected a {
    background-color: #FFF;
    color: #000;
    font-weight: 700;
    border-radius: 0px 0px 3px 3px;
    }

    @barchiola

    Participant

    i’ve made a few changes but still nothing
    /*
    Theme Name: BuddyPress_GSN
    Theme URI: http://www.giantscalenews.com/wp-content/themes/BuddyPress_Child_GSN/
    Description: GSN BuddyPress Child Theme
    Version: 2.1.1
    Author: Bart
    Author URI: http://www.giantscalenews.com
    Template: buddypress
    Tags: buddypress
    */
    #buddypress div.item-list-tabs ul li.selected a,
    #buddypress div.item-list-tabs ul li.current a {
    background-color: #eee;
    color: #555;
    font-weight: bold;
    border-radius: 0px, 0px, 4px, 4px;
    }

    @1a-spielwiese

    Participant

    1st:

    is the child theme folder in the wp-content/themes/ folder

    The child-theme folder is, were you have placed it.

    The child-theme folder should be on the same level of your folder-structure as your parent-theme (“comprehensive theme”)-folder.

    E.g.:

    • I have a folder wp-content/themes/reddle – for my parent theme
    • and a folder wp-contentent/themees/reddle-child – for my child.theme

    2nd:

    Theme Name: BuddyPress_GSN

    Template: buddypress

    I don’t know, whether it should work your way as well, but I do not refer on the BuddyPress-theme, rather on my WordPress-parent-theme – so, in my case the style.css of my child-theme beginns with:

    /*
     Theme Name:   Reddle Child
     Template:     reddle
    */

    3rd:

    You have to connect child- and parent-theme – in my case it is (as next line of my style.css) on the one hand:

    @import url("../reddle/style.css");

    And on the other hand you need a functions.php within your child-theme-folder as well. In my case it starts with:

    <?php

    /**
     * Enqueue stylesheet
     */
    function reddle_child_theme_stylesheet() {
    	wp_enqueue_style( 'reddle-child-themestyle', get_stylesheet_uri() );
    }
    add_action( 'wp_enqueue_scripts', 'reddle_child_theme_stylesheet' );

    4th:

    Finally you have to activate your child-theme. You do this within the admin panel of your WordPress-installation:

    http://1a-spielwiese.de/wp-admin/themes.php

    In the case, that you have installed WordPress MultiSite, you have to activate it on the network level as well:

    http://1a-spielwiese.de/wp-admin/network/themes.php

    Cfr.: https://buddypress.org/support/topic/buddypress-2-1-bp-language/page/2/#post-200308 (section 2nd).

    5th:

    I don’t know, whether it is state of the art – anyway it works for me:

    I insert as well my changes regarding my WordPress parent-theme as well as my changes regarding BuddyPress into my wp-content/themes/reddle-child/style.css.

    Further reading:

    https://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme

    @1a-spielwiese

    Participant

    Recte:

    Section 1st:

    “and a folder wp-contentent/themes/reddle-child” – and not: “themees”.

    Section 4th:

    @:

    http://1a-spielwiese.de/wp-admin/themes.php
    and
    http://1a-spielwiese.de/wp-admin/network/themes.php

    Of course, you have to substitute my domain by your domain.

    @barchiola

    Participant

    this goes back to my original question, we already have a theme and are running a child-theme of that. buddypress isn’t our theme, it’s an add-on to our theme.
    so when you say I have to activate our child theme in the Admin panel, I’ve seen this and have tried the preview and it takes over our real theme which is ClassiPress.
    Does that make sense? we don’t want BuddyPress to be our theme, it’s running as an Add-on and I’m trying to only make some minor color/layout changes.
    Thanks!
    Bart

    @1a-spielwiese

    Participant

    this goes back to my original question, we already have a theme and are running a child-theme of that.

    That’s fine. Then insert there your code:

    #buddypress div.item-list-tabs ul li.selected a,
    #buddypress div.item-list-tabs ul li.current a {
    background-color: #eee;
    color: #555;
    font-weight: bold;
    border-radius: 0px, 0px, 4px, 4px;
    }

    @1a-spielwiese

    Participant

    so when you say I have to activate our child theme in the Admin panel, I’ve seen this and have tried the preview and it takes over our real theme which is ClassiPress.

    Parent and child theme work the following way:

    If there is a style definition for e.g. h1 in the parent theme as well as in the child theme, then the style definition of the child theme for h1 is used.

    Is there only a definition in the parent theme for h1, then the parent theme definition is used.

    And the same regarding BuddyPress:

    If you write nothing regarding #buddypress div.item-list-tabs ul li.selected a into your child theme, then the BuddyPress-definition is used; otherwise the definition, which you make in your child theme, is used.

    Or saying the same thing in a more abstract way: The child theme does not substitute the entire parent theme, rather it has primacy in the case of contradictory style-definitions for the same element.

    @barchiola

    Participant

    I added the code to the bottom of the classipress child theme, saved it, refreshed my screen and nothing happened. maybe because i used cut-paste instead of typing it in.
    i’ll try again.
    when i inspect the elements buddypress is using the buddypress.min.css file and i’m tempted to edit that file for the heck of it just to see if it changes anything but so far i can’t get changes to show on the screen.
    thanks for all of the help, i really appreciate it.
    one more try
    bart

    @barchiola

    Participant

    typing the code in directly finally worked!
    you have no idea how grateful i am for you making yourself so available to help me see this through.
    everyone at giantscalenews.com says thank you!
    Bart

    @1a-spielwiese

    Participant

    1st:

    we don’t want BuddyPress to be our theme

    What I have described there did not make ‘BuddyPress’ my theme – and if you adapt my description to your case, it will also not make ‘BuddyPress’ your theme.

    (Anyway BuddyPress is no theme, though it concists of the bp-theme-folder. But ignore this folder.)

    2nd:

    real theme which is ClassiPress.

    That implies: Everywhere were I have written ‘reddle’ within my decription, you have to write ‘ClassiPress’; and were I have written ‘reddle-child’, you have to write ‘ClassiPress-child’.

    @1a-spielwiese

    Participant

    typing the code in directly finally worked!

    Cool.

    I added the code to the bottom of the classipress child theme, saved it, refreshed my screen and nothing happened. maybe because i used cut-paste instead of typing it in.

    I guess this could be not the reason, maybe it was because the browser or server cache.

    @barchiola

    Participant

    don’t know, i refresh after every css file update so not sure why it wouldn’t take but it’s good now and we’re making progress again!
    our buddypress pages are finally starting to look like the rest of the site.
    thank you very much
    bart

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Trying to understand Child Themes vs. Plugins’ is closed to new replies.
Skip to toolbar