• Hi all,

    I’m running the Mystique theme, which automatically creates a child theme. I had some custom code in the functions.php file, but then when the theme updated I lost that code. No problem I thought, I’ll just put the code back in–but this time, I’ll put it in the child theme folder.

    So I copy the entire functions.php file to my child theme folder and promptly broke the site. I assumed that WordPress would load the child theme functions.php instead of the main theme functions.php, but instead it loaded both of theme.

    No problem, I just deleted the functions.php file from the child theme and restored functionality.

    However, I’m still getting some lingering errors. My comment fields are blank (so rather than displaying “Name” in the field where users should put their names to comment, it displays nothing), and my theme settings pages says

    ““Warning: fopen(/home/impro/public_html/wp/wp-content/themes/mystique-extend/lang/.mo) [function.fopen]: failed to open stream: No such file or directory in /home/impr/public_html/wp/wp-includes/pomo/streams.php on line 109″”

    How do I fix this error and make sure my site returns to normal?

    Is it possible to reinstall my main theme without losing the settings in my child theme?

    Is it possible to reinstall my child theme without deleting my main theme?

    What is my best course of action here?

    Any advice would be appreciate ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • Did the original functions.php for the child theme have anything in it that may be missing?

    I would deactivate/delete the child theme… and reupload the original child theme…. have you made many mods within the child?

    functions.php is a special file in a child theme. It loads in addition to the parents functions.php.

    So you cannot copy stuff from parent to child necessarily unless the function_exists is present in the parent for the particular function.

    For other modifications through child functions.php you can use filters, etc…..

    The child theme files should be able to be copied from a fresh download of the mystique theme, and reupload through FTP

    Thread Starter SocialskillsDan

    (@socialskillsdan)

    Hi Voodoo,

    The theme put lots of options in my WordPress dashboard which I have customized. However, I have not done a lot of mucking about in the actual files of the theme. I’m primarily worried about losing my widget configuration, etc — would I lose that if I deleted and then reuploaded the child theme?

    Normally you would not.

    Since your child theme and parent theme have the same layout, you normally should be fine….

    I would think you could switch to the parent theme, and reinstall the child…

    Notice I keep saying normally should…. I can’t be 100%, but in similar situations I have not lost my settings.

    I’ve never used mystique, does it allow you to export/backup your settings?

    Thread Starter SocialskillsDan

    (@socialskillsdan)

    Yes, Mystique has an option where it says I can reset/backup/import theme options, and it gives me a string of gobbelgook like that I can copy-paste. I believe that I can copy-paste that to refresh my settings, but I’m kind of nervous to delete the child theme in case it screws things up ?? I guess it’s necessary, though.

    So to be clear

    1) I should switch to parent theme
    2) I should delete child theme
    3) I should upload the child theme folder back into my web host
    4) I should reactivate the child theme
    5) I should copy-paste the string of settings.

    And that should fix things. Sound good? ?? Sorry to be so tentative; I just don’t want to inadvertently mess things up MORE

    That sounds like it would work to me.

    You may find you do not have to re-import those settings. But keep hold of ’em anyway, just in case!

    Thread Starter SocialskillsDan

    (@socialskillsdan)

    Hi Voodoo,

    I went ahead and changed from the child theme to the parent theme. I was able to successfully copy the settings through the copy paste method–the only thing that was not preserved was the menus (which are easy enough to set up.) However, this did not fix the issue of no text appearing in comment fields. I can go ahead and reinstall the child theme as originally planned, but I feel like if the issue was with the child theme, activating the parent theme would have fixed the issue. So I’m hesitant to go through the process of a reinstall.

    Do you know any other ideas for solving the problem of the blank comment fields? That’s the only actual error I’m encountering; the error message in the theme page is annoying but I don’t think it’s actually causing any problems.

    Thanks so much for all of your help, by the way. I really appreciate you sharing your time and brain power to help me solve this ??

    If you switch to the 2011 theme for a moment, does the comment stuff come back?

    Thread Starter SocialskillsDan

    (@socialskillsdan)

    Yes, 2011 has the comment stuff working correctly. So perhaps it’s a problem with my theme itself? However, if that’s the case, how do I fix it?

    It’s very hard for me to suggest anything, not knowing how that theme works, or what’s been done to it.

    Best I can suggest is to totally delete and reinstall it. Then from now on, activate and only edit the child theme. Never the parent. That should keep you safe.

    Thread Starter SocialskillsDan

    (@socialskillsdan)

    Hi Voodoo,

    I uninstalled and reinstalled both parent and child themes, and that fixed the issue ?? Thanks for your patience and support!

    SUre thing! I”m glad you were able to resolve your issue!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Copied entire functions.php file to child theme and broke the site’ is closed to new replies.