• Resolved fasteddie10851

    (@fasteddie10851)


    Hello,

    I created a child theme to modify the parent I was using. Im using the Modest theme from elegant themes. I successfully created a child theme with the style.css file but when I try to add a functions.php file the website crashes. I cannot get to the home page or login page. I get a return server error. When I remove the functions file the website returns to normal. How to you implement a functions.php file into a child theme?

    I used the opening php tag <?php and closed with ?>. I put my functions modification between, the syntax seemed ok. The editor Im using checks syntax when you write the code. I can place the functions modification into the themes functions.php file but if I update the theme the functions mod will be removed. I tried the…

    include ‘/wp-includes/functions.php’; command but that did not change anything.

    I also have to create a different footer.php file. Im afraid of running into the same problem.

    Thanks in advance.

    this is what my functions.php file looks like

    <?php
    include ‘/wp-includes/functions.php’;

    function exclude_category($query) {
    if (&query->is_home() ) {
    $query->set(‘cat’, ‘-10 -6 -2 -1’);
    }
    return $query;
    }
    add_filter(‘pre-get_posts’, ‘exclude_category’);
    ?>

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘functions.php crash in my child theme’ is closed to new replies.