621 pointsLike some sort of WPMU DEV God"I'm new here
tishimself
Member
—
16th August 2011
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.
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.
>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.
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.
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.
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
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.
Do I change the line to
<?php load_template (dirname(__FILE__) . '/includes/main-navigation.php'); ?>
or
<?php load_template (get_bloginfo('stylesheet_directory'). '/includes/main-navigation.php'); ?>
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:
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.
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.
Responses (16)
Sales & Support Pro — 16th August 2011 #
Hiya Larry,
If you just want to change the text you should instead provide a translation.
Furthermore, the text concerned is likely to be BuddyPress or even WordPress text rather than text from the theme.
Phil
Member — 16th August 2011 #
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
Sales & Support Pro — 17th August 2011 #
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
Member — 17th August 2011 #
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
Sales & Support Pro — 17th August 2011 #
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
Member — 17th August 2011 #
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
Sales & Support Pro — 17th August 2011 #
Hmm. Okay, let me ask one of the devs to take a look and see what I've done wrong....
Member — 1st September 2011 #
Hi,
Any Progress?
Regards,
Larry
Developer — 3rd September 2011 #
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.
Member — 4th September 2011 #
Hi,
Do I change the line to
<?php load_template (dirname(__FILE__) . '/includes/main-navigation.php'); ?>
or
<?php load_template (get_bloginfo('stylesheet_directory'). '/includes/main-navigation.php'); ?>
Regards,
Larry
Sales & Support Pro — 5th September 2011 #
Larry,
Change it to;
<?php load_template (get_bloginfo('stylesheet_directory'). '/includes/main-navigation.php'); ?>Cheers,
Phil
Member — 7th September 2011 #
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:
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
Developer — 8th September 2011 #
Okay, can you please try changing the line to this:
<?php load_template (dirname(__FILE__) . '/includes/main-navigation.php'); ?>and see if it helps?
Member — 8th September 2011 #
Hi,
Great, that works!
Do I need to keep all the /include/ files in the child theme or just the main-navigation.php?
Thanks,
Larry
Developer — 9th September 2011 #
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.
Sales & Support Pro — 13th October 2011 #
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
Become a member