Child Scholar Theme /incudes/ main-navigation.php changes not taking effect.

Hi,

I wanted to change the Categories and Community tab text, so I copied the /includes/ folder into the Child theme and made my changes. The changes to main-navigation.php did not take effect. Why not?

I then updated the file in the main scholar/includes/ theme folder and they took effect.

BTW, other changes work fine, like thos for the Blogs & Membership index pages.

Larry

  • tishimself
    • Syntax Hero

    Hi,

    I dunno what you mean by "translation".

    >Furthermore, the text concerned is likely to be BuddyPress or even WordPress text rather than text from the theme.
    ok, but.... "I then updated the file in the main scholar/includes/ theme folder and they took effect."

    When I modify the theme file in the bp-scholar /includes/ folder the change works. Maybe a "translation" is a better way, but it worked. What I don't understand is why putting a copy in the scholar-child theme /includes/ folder does not work. Maybe the /includes/ theme folder is an exception to the rule.

    Unless there is a better way, I need to find out why these updates in the child theme /includes/ folder is not working. I need all my changes made in the Child theme.

    Kind regards,
    Larry

  • Philip John
    • DEV MAN’s Apprentice

    Larry,

    Have you made sure that you have maintained the directory structure when copying over the files, and is your child style.css correctly marked up and recognised by WordPress?

    Your text changes will be overwritten when you update the theme. Using a translation means that you can easily re-apply the language file.

    Phil

  • tishimself
    • Syntax Hero

    Hi,

    I have checked and recheck myself for dumb typos and such. The file structure for the child them matches that of the base theme:
    /bp-scholar/includes/main-navigation.php
    /bp-scholar-child/includes/main-navigation.php

    While this change does not require a change to /_inc/css/child.css, I have changed it for the slideshow. And I have also updated sldeshow.php in the child theme.

    To be clear, I have made a number of small changes using the dhild theme, but only this one is in the /includes/ fiolder. The ones to /members/index.php and /blogs/index.php are working fine as are the ones in the root child theme for header.php, footer.php and slideshow.php.

    Kind regards,
    Larry

  • Philip John
    • DEV MAN’s Apprentice

    Okay, thanks for all the extra info. I believe I may have found the cause now.

    On line 203 of header.php (in the parent) is this;
    <?php load_template (TEMPLATEPATH . '/includes/main-navigation.php'); ?>

    Try changing it to this;
    <?php load_template (get_bloginfo('stylesheet_directory'). '/includes/main-navigation.php'); ?>

    If you have header.php in your child theme, change it there instead of the parent.

    Let me know if that changes the issue in relation to changes to main-navigation.php. If so it means we have the cause and can get a permanent fix in.

    Phil

  • tishimself
    • Syntax Hero

    Hi,

    I think you are on the right track, but when I made this change website content disappeared. The header was left, but the scroller on down was just a grey blank..

    BTW, backed out my header changes in he child theme b4 I applied your change so that it was the only change in header.php

    Larry

  • Vladislav
    • Dead Eye Dev

    Hi,

    First, I'd like to confirm that the "includes" directory is indeed an exception to inheritance rule - that folder is meant for things that are globally available to your main and child themes both.

    If you want to make some changes to main-navigation.php that should be specific to your child theme only, you may want to override both header.php and main-navgation.php in your child theme. This is how you may want to go about doing that:

    1) Copy over bp-scholar/includes/main-navigation.php to bp-scholar-child/includes/main-navigation.php and edit it as you see fit
    2) If you have header.php in your child theme already (bp-scholar-child/header.php), skip the next step
    3) Copy over bp-scholar/header.php to bp-scholar-child/header.php
    4) Open bp-scholar-child/header.php (so, the *child theme* header.php, *not* the main theme one) and navigate to line 203, as Phil said
    5) Change it to this:
    <?php load_template (dirname(__FILE__) . '/includes/main-navigation.php'); ?>

    The main point is that we're overriding the main theme main-navigation.php by overriding *both* header.php and main-navigation.php in the child theme. If you still see the blank area below your header, please make sure you don't have any PHP errors in your main-navigation.php.

  • tishimself
    • Syntax Hero

    Hi,

    I'm pretty sure that is just what I did before, but I tried again to be sure..

    I copied the working main-navigation.php form the parent theme to the child theme folder so that I was sure there were no errors.

    (Now I have modified the parent theme main-navigation.php *text* to get what I want. There is no logic that I have changed only text. But like I said this is the present working version of this file. These are the very changes I need to move to the child theme folder. For example, line 23 now look like this:

  • <?php _e( 'Find a Practitioner', 'bp_scholar' ) ?>
    My only point is to assure you that the changes are simple text and not logic changes.)

    Then updated line 203 in the header.php located in the child theme.

    Then I get the grey area on my home page washing out most everything but the top part of the page.

    When I replace line 203 in the child header.php it works again, the grey is gone.

    Regards,
    Larry

  • Vladislav
    • Dead Eye Dev

    Hi,

    If the main-navigation.php is the only file you'll be changing, there is no need to have any other file in your child theme's include folder.

    However, if you want to customize other files from that folder for your child theme and include them with this technique, you'll want to copy them over too.

  • Philip John
    • DEV MAN’s Apprentice

    Hiya,

    As we haven't heard back from you we're going to assume the problem was sorted out and mark this thread as resolved.

    If it wasn't resolved, or you have any more questions related to this thread please feel free to post them below and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Otherwise, thanks for using the forums, and, as always, for being a member of WPMU DEV, it's a pleasure to help you out and we look forward to being of assistance in the future.

    Cheers,
    Phil

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.