Child theme not working

Hi,

I have tried to read all threads so I am sorry if I duplicate.

I am using Buddypress Corporate theme. I followed the video and can change the footer.php with no problem. I have buddypress installed on the main blog and to keep design consistency I want to use the same theme on the subdomain blog for support.myblog.com. I need the same navigation on both blogs.

I need to

a. Add links to external sites in the navigation of both sites
b. When I activate the child theme on the main blog I get links under 'community' to the groups etc on the main site which is correct. However the links in the subdomain support.myblog.com all point to non-existent pages on my subdomain ie support.myblog.com/activity/. I don't have groups etc on my subdomains but the navigation menu looks for them.

I've been trying for ages to change includes/main-navigation.php in the child theme, I created an /includes/ folder the made the changes in the navigation to hard code links to my main blogs community sections but the changes are not showing in my child theme. I can change the footer.php though so I know I have got the right principal.
Please could someone point me in the right direction. Thanks.

  • Tammie

    @jc57: Just to clarify before I help a few things.

    1. You have tagged this community theme but say corporate in your post - which is it?
    2. Are you running wordpress or wordpress mu and I take it you are running buddypress? Also what version are you running of them all?
    3. Are you running the latest version of corporate or community - whichever theme it is?
    4. By video do you mean the parent and child tutorial video?

  • Tammie

    @jc57: I think the issue is you are confusing perhaps child and parent with main and sub blog. Themes don't refer to blogs at all. Forgive me if this is not the case though. Basically, you 'can' use it on a non main blog BUT you will loose a lot of the functionality as you won't have Buddypress installed. It 'should' be picking up the 'if bp-existed' and seeing it's not however I'm not sure that is the case here as a little confused as to what you mean by main and sub blog... can you explain please.

    My thoughts however from what you are saying is that you may have an issue with a line such as:

    <?php load_template (TEMPLATEPATH . '/navigation.php'); ?>

    This would be saying 'look in the template for that file' now that would basically mean whatever you put in the child wouldn't get picked up if you used navigation... thus creating an issue if this is what you mean.

    You 'can't get around this by editing it to be:

    <?php load_template (STYLESHEETPATH . '/navigation.php'); ?>

    OR

    <?php locate_template( array( 'navigation.php' ), true ); ?>

    Please bare in mind neither of these I've tested just trying to theorise whilst work it out for you.

    Hopefully though I've either hit the problem or we are at least on the path to sorting.

  • Tammie

    @jc57: lol ok so it's scholar.... right well then all the code I just added ignore it then lol - bad baby leading to sleep lack.

    However the same principle can apply:

    <?php if( $bp_existed == 'true' ) { //check if bp existed ?>
    <?php load_template (TEMPLATEPATH . '/includes/main-navigation.php'); ?>
    <?php } else { // if not bp detected..let go normal ?>

    In header.php make that:

    <?php if( $bp_existed == 'true' ) { //check if bp existed ?>
    <?php locate_template( array( '/includes/navigation.php' ), true ); ?>
    <?php } else { // if not bp detected..let go normal ?>

  • jc57

    My steps were

    1. Copy both parent and child to public_html/wp-content/themes (just the complete folder bp-scholar and bp-scholar-child
    2. Copy across footer.php to bp-scholar-child root. Modify (add a new link to footer) and upload to bp-scholar-child root by ftp. Works fine I can see my changes.
    3. Create includes folder in bp-scholar-child root then copy the original main-navigation.php into this folder. Modify the navigation to add a new hardcoded url to our buddypress support forum just before the community tab + I want to hardcode the links to the main blogs Buddypress installation so I can use this theme for all my subdomain blogs therefore keeping the same navigation for all as the subdomain blogs' Buddypress links go to subdomain.myblog.com/activity' etc and I need 'myblog.com/activity.

    I modified it as follows:

    <?php _e( 'Community', 'bp_scholar' ) ?>

  • Tammie

    @jc57: Follow my steps above your post and you should pick up your navigation file. BUT you will also have to edit the bp_existed stuff out to get it to work you see this where you say the following:

    3. Create includes folder in bp-scholar-child root then copy the original main-navigation.php into this folder. Modify the navigation to add a new hardcoded url to our buddypress support forum just before the community tab + I want to hardcode the links to the main blogs Buddypress installation so I can use this theme for all my subdomain blogs therefore keeping the same navigation for all as the subdomain blogs' Buddypress links go to subdomain.myblog.com/activity' etc and I need 'myblog.com/activity.

    What you basically have to work around is the following in header.php:

    <?php if( $bp_existed == 'true' ) { //check if bp existed ?>
    		<?php load_template (TEMPLATEPATH . '/includes/main-navigation.php'); ?>
    		<?php } else { // if not bp detected..let go normal ?>

    You either remove the bp_existed or you create a child header.php and do that. Basically it's saying IF buddypress is installed show this well you won't have it installed on the internal blog so you can't link back... hence you won't see for that reason. However, you also won't see until you do the STYLESHEET change :slight_smile:

    I think this one is maybe one to do after sleep it's a bit complex.

  • jc57

    Great it worked. I put:

    <?php if( $bp_existed == 'true' ) { //check if bp existed and put in code to make nav work -Judy?>
    <?php locate_template( array( '/includes/main-navigation.php' ), true ); ?>
    <?php } else { // if not bp detected..let go normal ?>

    into the header. I know I'm on a subdomain but with buddypress being activated sitewide. I want to give a consistent look and to customize a normal theme to look like my main blogs buddypress theme it would be so much work so I wanted to just use the scholar theme for both.

    Thanks a lot! :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.