• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 69
  • Last Modified:

WordPress Child Theme Issue

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
Richard Korts
Asked:
Richard Korts
  • 9
  • 5
  • 3
  • +2
2 Solutions
 
Terry WoodsIT GuruCommented:
Could it be a caching issue? Are you using any caching plugins? Have you tried loading the site in a private browser window?
0
 
Richard KortsAuthor Commented:
There are no caching plugins.

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

Thanks
0
 
Terry WoodsIT GuruCommented:
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
Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

 
Richard KortsAuthor Commented:
Terry, great, I'll try it.
0
 
Terry WoodsIT GuruCommented:
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
 
Richard KortsAuthor Commented:
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
 
Terry WoodsIT GuruCommented:
Sounds like it might be... there's some notes about caching on the WPEngine site here: https://wpengine.com/support/cache/
0
 
Jason C. LevineNo oneCommented:
(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
 
Julian HansenCommented:
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
 
Richard KortsAuthor Commented:
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
 
Julian HansenCommented:
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
 
chilternPCCommented:
I'd go with Jason's comment
0
 
Richard KortsAuthor Commented:
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
 
Richard KortsAuthor Commented:
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
 
Richard KortsAuthor Commented:
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
 
Julian HansenCommented:
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
 
Richard KortsAuthor Commented:
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
 
Terry WoodsIT GuruCommented:
Glad you got it working! Don't forget to close the question...
0
 
Richard KortsAuthor Commented:
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 9
  • 5
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now