Solved

WordPress Child Theme Issue

Posted on 2016-09-21
19
37 Views
Last Modified: 2016-09-22
I have addressed this issue before, now I am down to brass tacks (crunch time).

We have a staging site that we have used for about 3 months to develop some custom stuff to add to an Enfold Theme WordPress site.

Meantime (since June), the live site has had numerous content updates. We are trying to merge the two.

I decided on this approach.

(1) I dropped all the wp- tables from the staging site database, then copied over the same from the live site, using phpmyadmin.

(2) The site now thinks it's using the base (not child) theme, but it recognizes that the child theme is there, I activated the child theme, I had to reset things like the logo, favicon, home page, etc. That was fine.

(3) If you use the Editor (Themes, Appearance), the CSS, functions.php & header.php are all there (as they were BEFORE copying over the DB tables), but it does not appear to be applying the CSS to the theme. The site appearance, once I recreate the child theme, is what looks like some garish color scheme, etc. I remember before when I first did that, it looked like that too.

Is there something I have to do to the child theme to make it use the custom css? I'm not sure if it's using the custom header & functions. How can I make that happen?

Thanks
0
Comment
Question by:Richard Korts
  • 9
  • 5
  • 3
  • +2
19 Comments
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41809864
Could it be a caching issue? Are you using any caching plugins? Have you tried loading the site in a private browser window?
0
 

Author Comment

by:Richard Korts
ID: 41809865
There are no caching plugins.

I don't know how to open a "private" browser window. Please educate me.

Thanks
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41809868
In Chrome, there's a "New incognito window" option in the menu (shortcut ctrl-shift-n)
In Firefox, there's a "New Private Window" option in the File menu (shortcut ctrl-shift-p)
Edge has a "New InPrivate Window" option too.

All of these load a page without accessing the browser cache, and don't store cached files, cookies or passwords etc once they've been closed.
0
 

Author Comment

by:Richard Korts
ID: 41809874
Terry, great, I'll try it.
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41809877
There's some notes on caching here: https://codex.wordpress.org/I_Make_Changes_and_Nothing_Happens

The private window technique avoids browser caching issues. It could be the case that you've got some Server-side Caching as described in the above link. You almost certainly haven't set up Cloudflare on a staging site, so it probably won't be that.
0
 

Author Comment

by:Richard Korts
ID: 41809881
I have never heard of Cloudflare, but one thing I forgot & should have mentioned is the site is hosted at WPEngine.

I have found that to be a mixed bag, it MIGHT be connected with them.
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41809888
Sounds like it might be... there's some notes about caching on the WPEngine site here: https://wpengine.com/support/cache/
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 100 total points
ID: 41809966
(1) I dropped all the wp- tables from the staging site database, then copied over the same from the live site, using phpmyadmin.

This was probably not a good idea.  When you did this, you made the wp-options data from the live site active on the staging site and unless you do a search and replace on the tables to change URLs and paths from one environment to the other, stuff will behave strangely.  My guess is the staging site is looking for paths that are not correct and defaulting back to basics or trying to import files from URLs in a way that is considered cross-site scripting so it's being blocked.
1
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41810082
Are you trying to make an exact copy of live to stage?

If so you can try the WP All In One Migration tool https://en-za.wordpress.org/plugins/all-in-one-wp-migration/

In the Advanced option of the export disable the media and spam posts.
Create a snapshot and then use the same plugin on stage to import the snapshot.

This will migrate the urls and other site specific settings.

You can copy the media over by ftp.

I have found if media is included in the snapshot - firstly your snapshot is big and sometimes get reported as corrupted and secondly you run into the 512MB limit on the free version.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:Richard Korts
ID: 41810623
I am trying to merge the two without, if possible, effecting the live site until everything is good.

I need to maintain all the live site content entered since the staging site was created.

I know how to move the custom code, tables & pages to the live site.

My MAIN concern is the child theme, how do I create that & make it identical to the staging site WITHOUT disrupting the live site?

I'm thinking just create it, copy over functions.php, styles.css & header.php from the staging, then switch the live site theme to the child theme. If it looks good, THEN move the custom stuff. The custom stuff is only accessible visually from one doorway, add that LAST.

Does that sound reasonable? Issues with that plan?

Thanks
0
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 400 total points
ID: 41810821
A child theme is just a folder on your system - so in theory you should just be able to copy it across and as long as the theme info in the style.css is good and the parent theme it refers to is present you should be good to go.
0
 
LVL 28

Expert Comment

by:chilternPC
ID: 41810865
I'd go with Jason's comment
0
 

Author Comment

by:Richard Korts
ID: 41811064
Julian,

I tried that. Everything looks pretty good, EXCEPT the site footer.

See attached. The image called "footer_child_live.jpg" is what the footer looks like in the child.

The image "footer_live.jpg" is what it's supposed to look like.

Note there are two differences:

(1) White background (instead of black) in child, different font colors.

(2) Extra stuff at the bottom in Child.

Ideas on how to fix this?

Rest of css, header, menus, etc all look good.

Thanks
footer_child_live.jpg
footer_live.jpg
0
 

Author Comment

by:Richard Korts
ID: 41811129
I solved the footer issues, it is in the Theme Styling area (for the Enfold Theme).

So I think it has passed step 1, I'm asking the customer to look at it now.

Thanks
0
 

Author Comment

by:Richard Korts
ID: 41811260
I have a maddening minor issue. The font color on buttons is a sort of gray, I think #808080.

It needs to be white.

I CANNOT figure out how to make that happen.

I recognize it's in the theme styling, but I can find no place to do that.

Help!!
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41811411
If you have it in live right click the button and Inspect Element - check the styles tab to see where that style is being defined.

Then repeat the process on stage to see if either something is missing from stage OR something on stage is overwriting the style - that is where I would look.

Do you have links we can look at.
0
 

Author Comment

by:Richard Korts
ID: 41811530
I figured it out. I added custom css to force button text #FFF

I think I have live now working in the child theme.

Next step, try to activate the custom stuff.

We shall see.

Thanks
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41811666
Glad you got it working! Don't forget to close the question...
0
 

Author Closing Comment

by:Richard Korts
ID: 41811676
Twas a nightmare, but I think I got it all.

Looking pretty good, I asked customer to review with a fine tooth comb.

Richard
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

What's this? As a volunteer Page Editor for Experts-Exchange.com, I have noticed that many authors also have blogs, and pull articles from their blogs to post at Experts-Exchange. I appreciate each author sharing their blog content with our site …
WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now