Community Forums › Forums › Archived Forums › Design Tips and Tricks › Re-visiting issues with child-theme CSS and PHP
Tagged: child theme, php
- This topic has 17 replies, 3 voices, and was last updated 8 years, 4 months ago by
okieman.
-
AuthorPosts
-
October 11, 2016 at 9:54 am #194512
okieman
MemberSix months ago, you folks helped me diagnose loading CSS for our child theme to Outreach Pro. Recently I began noticing that our navigation menu was not properly centering on small devices like a mobile phone. When I inspected those non-centered nav links, the CSS seemed to be from our default stylesheet in the Outreach Pro directory. Tinkering with functions.php crashed the theme itself. This last version that crashed was from the official WordPress codex.
My best guess is that the codex PHP for loading a child theme was not intended to be used word-for-word. They may have assumed I would customize the language to reflect the literal theme name, or child theme name. I've read conflicting information on this. Comments?
(Link below looks normal because I have temporarily added our custom CSS to the default Outreach Pro style sheet.)
http://www.tulsaunity.com/October 11, 2016 at 10:15 am #194514Christoph
MemberHi,
why were you making changes to functions.php when you want to make changes to style.css?
Could you please add more details about what you are referring to when you say
This last version that crashed was from the official WordPress codex.
My best guess is that the codex PHP for loading a child theme was not intended to be used word-for-word.Thank you.
October 11, 2016 at 10:34 am #194518okieman
MemberChristoph, I used Chrome's F12 diagnostic tool to look at the navigation bar links. That told me the CSS was from the default style sheet, not the child theme CSS. That's when I started thinking that my functions.php within the child theme was no longer working. I thought one of the recent updates to Genesis might have caused a problem.
The link below goes to the page where I used PHP that generated fatal errors. In my research, I have seen some WordPress authors say that when they load a child theme, they replace some of this language with names that are specific to their own site.
October 11, 2016 at 11:04 am #194522Christoph
MemberHi,
thank you for the background.
Did you already undo the changes to functions.php?
Doesn't look like child-style.css is being loaded.
October 11, 2016 at 11:41 am #194525okieman
MemberI can install the functions file that was working six months ago. It will be this evening.
October 11, 2016 at 5:40 pm #194549okieman
MemberDNS went out at my ISP, and they want 24 hours to repair. I'll be back when they are done!
October 11, 2016 at 8:38 pm #194553okieman
MemberThe child theme installed fine then crashed our site on activation. Deleted it from server then re-installed Outreach Pro. Here are errors we saw instead of our site content.
October 11, 2016 at 8:44 pm #194556Christoph
MemberYou can use the code button on top of the editor to wrap code.
All that one line tells me is that you were trying to embed images from imgur and something went wrong...
October 11, 2016 at 8:56 pm #194557okieman
MemberEach time I drop the error message text between the "code" tic marks, and click Submit for the post, it shoots me back to the forum entry page. Tried logging out and back in, same problem. I think StudioPress chokes on some of the words in the error, like the one that starts with "f" ends in "atal"
The imgur embed code broke even worse. Please try right clicking to new tab on the above image load attempt.
October 11, 2016 at 9:07 pm #194560Christoph
MemberCould you paste the error message into a Gist or file in a dropbox folder (or any other content sharing service you use) and link to it here?
October 11, 2016 at 9:27 pm #194564okieman
MemberI'm headed home for the evening. Will pick this up tomorrow. Also here is download of child theme as a zip ...
October 12, 2016 at 6:26 pm #194611okieman
MemberLinks in post above for Dropbox (errors in plain text) and zip file (child theme that crashed the site).
October 12, 2016 at 9:29 pm #194621okieman
MemberSome preliminary research, from the error messages. For unknown reasons, activation of the child theme functions.php is causing PHP in the parent theme functions.php to attempt including files from the wrong locations.
wp-content/themes/outreach-pro-child/lib/theme-defaults.php
This part of the path is only accurate if you remove "-child"And the following init.php is actually located in the Genesis directory ...
wp-content/themes/outreach-pro/lib/init.php
But I don't yet know enough about PHP to revise the parent functions.php so that it looks for these in the correct locations??
October 13, 2016 at 8:05 am #194643Christoph
MemberIt looks like you are trying to create a grand-child theme which WordPress doesn't really support.
(Outreach Pro is the child theme. Genesis is the parent theme. )Not sure if that's what you intended or if that just happened when you made changes to functions.php.
To circle back to my previous question, if you undo the changes to functions.php, does your website load again?
October 13, 2016 at 10:11 am #194655okieman
MemberIt wasn't until this past week that I realized our efforts to load custom CSS was in the category of a grand-child theme. Frustrating, because it could mean that we will have manually customize the Outreach Pro style sheet every time the theme is updated. I wish the vendor for this theme had let us know what we were getting into.
The site is stable now, after deleting the entire child (grandchild) directory via FTP. And manually inserting our own CSS in the style sheet located in the Outreach Pro directory. I have considered modifying the parent theme functions.php so that the correct paths for the two include files are hard coded. But even that is starting to look like experimentation.
Have searched the Web for other people using Outreach Pro, and any comments about how they achieved child theme functionality. So far, no solutions.
October 13, 2016 at 10:19 am #194656Christoph
MemberJust to clarify, Outreach Pro is the child theme and it is not automatically updated.
I also would not expect an important / functionality changing update, because it seems to be stable at version 3.1 since August 2014.Do not change the Genesis parent theme because any changes will be overridden by updates.
If you really wanted to, you could use a plugin to add your custom.css or, as it seemed you did from your previous topic, enqueue an additional css file.
October 13, 2016 at 10:33 am #194657Andrea Rennick
MemberFrustrating, because it could mean that we will have manually customize the Outreach Pro style sheet every time the theme is updated. I wish the vendor for this theme had let us know what we were getting into.
As was said earlier, you cannot create a child theme from a child theme. WordPress does not support this. It is not specific to Genesis only.
Child themes do not get upgraded.
Every single official code snippet on our site says to modify the child theme you have - in this case Outreach pro. That is the correct method.
**forum signature**
If you need technical support for your theme please file a ticket.The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.
October 13, 2016 at 12:45 pm #194677okieman
MemberClosed
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.