Support » Fixing WordPress » Child Theme. ” Internal Server Error” when creating new pages.

  • I got a child Theme.
    I get ” Internal Server Error” when creating new pages.
    This does not happen in the original father theme.

    I only have functions.php and style.css in the child theme.
    style.css only has theme information; no code!
    functions.php code is as follows:

    <?php
    
    add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
    
    function enqueue_parent_styles() {
       wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    }
    
    

    Should i have an exact skeleton replica of the father theme at all times in the child theme for things to work properly?

    What’s the correct way to do things; regarding the child theme?

    And most importantly; how do i fix this, so i can access the pages?

    • This topic was modified 7 months, 1 week ago by  johnatanasoff.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Steve Stern

    (@sterndata)

    Support Volunteer

    Errors like this are logged. Check the error log on your server. If you can’t find the log, please contact your host.

    Meantime, enable wp_debug and wp_debug_log and after an error, look at wp-content/debug.log to see if anything gets logged there. https://codex.wordpress.org/Debugging_in_WordPress

    You can also try this: Please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.

    If you cannot access wp-admin, there are other ways to deactivate plugins.

    Subrata Sarkar

    (@subrataemfluence)

    Its hard to tell what exactly went wrong because from the code snippet and what you have done so far look ok.

    Please clear your browser cache once and then try again. If this does not solve your problem, I would suggest you to have a deep reading of https://codex.wordpress.org/Child_Themes and then try to create the child theme from the scratch following the instructions in the mentioned article properly.

    @sterndata Thanks Steve!

    The error log has been showing in the public_html folder, but right now it’s not; plus i usually delete it!

    – wp_debug and wp_debug_log enabled! Nothing in wp-content!

    – No need to activate Twenty themes! When i activate onetone theme it works! When i activate onetone_child it doesn’t.

    – Disabled the two plugins i had active and problem persists!

    I suspect functions.php needs extra code or the folder needs extra files.
    I only have these as i mentioned πŸ™‚ http://prntscr.com/hzo8rs

    Error http://prntscr.com/hzpq6c

    @subrataemfluence Thanks Subrata!

    Cache clearing didn’t work!

    I’ll look at the article you sent, more deeply, and see if i can solve the issue; but as http://prntscr.com/hzo8rs is all i have, it shouldn’t be too hard to come up with a solution πŸ˜‰

    @sterndata @subrataemfluence

    I read https://codex.wordpress.org/Child_Themes carefully, and think i understood it!

    I know a child theme should be done right from the start, but since i already modified the parent theme; what method you recommend?

    1) Child Theme Configurator plugin
    2) http://techblog.kjodle.net/2014/04/12/wordpress-child-themes-the-whys-and-hows/#What_if_I8217ve_already_made_changes_to_my_original_theme

    I avoid using plugins, unless strictly necessary; although some are really ingenious.
    Have you used method 1 or 2, and can recommend me the best approach?

    Moderator Steve Stern

    (@sterndata)

    Support Volunteer

    I use the method outlined in the codex to create child themes. If you started modifications on the parent, you should get a clean copy of the parent, figure out what you modified, and make a new child that can be run from an unmodified parent.

    @sterndata

    Followed the manual way:
    http://techblog.kjodle.net/2014/04/12/wordpress-child-themes-the-whys-and-hows/#What_if_I8217ve_already_made_changes_to_my_original_theme

    Did a WinMerge compare for the style.css copying only the changed css, and putting (altered files entirely, and respective directories) in the child theme dir.
    Apart from NOT being able to access pages which now are broken on father and child themes; everything looks ok!

    I use the method outlined in the codex to create child themes.

    Meaning you start a child theme right from the beginning, with a clean father theme?

    You never did anything manually or used Child Theme Configuration plugin after changing the father theme?
    Asking because of your experience.

    Moderator Steve Stern

    (@sterndata)

    Support Volunteer

    Meaning you start a child theme right from the beginning, with a clean father theme?

    right.

    You never did anything manually or used Child Theme Configuration plugin after changing the father theme?

    I used the plugin once just to see what it did. I prefer the manual methods because if something breaks, I know it’s something I did and don’t have to dig through plugins to see what they might have done.

    (edit)… that should be “when something breaks” πŸ™‚

    • This reply was modified 7 months, 1 week ago by  Steve Stern.

    @sterndata

    I also prefer the manual route for everything!

    At this moment, I exceptionally have “Better Search Replace”, as i needed it to fix something, and move from http to https; and “WP Mail SMTP”. That’s it!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Child Theme. ” Internal Server Error” when creating new pages.’ is closed to new replies.