• Resolved gameslopedy

    (@yiggory)


    Fatal Error Called Undefined function

    I got this error on this page: NSFW Link
    The error code says:
    Code:
    Fatal error: Call to undefined function the_comments_navigation() in/home/****/public_html/wp-content/themes/twentysixteen-child/comments.php on line49

    Why is this happens only for the above page?
    How to fix it?

    Thanks..

    Using: Twentysixteen theme
    Wordpress 4.3.1
    Captcha Installed etc..

    [ No bumping please. ]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    How did you create your child theme for Twenty Sixteen?

    Thread Starter gameslopedy

    (@yiggory)

    By the method of most common one.

    I used to put some codes into functions.php for creating child theme.

    Where the error comes from? Could you know of it?

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    By the method of most common one.

    No, I don’t think so. ??

    A child theme has 2 files at a minimum. A style.css file and a functions.php file. Nothing else. That’s documented here.

    https://codex.www.ads-software.com/Child_Themes

    You’re getting errors on wp-content/themes/twentysixteen-child/comments.php and that file should not even exist.

    Did you copy files from the parent directory into the child directory? If so which ones and why?

    Thread Starter gameslopedy

    (@yiggory)

    I copied all of the files from parent directory to child because I want to edit all of them.

    Thread Starter gameslopedy

    (@yiggory)

    comments.php deleted on child folder but the error still continues…

    Thread Starter gameslopedy

    (@yiggory)

    Okay deleted the navigation code and it has fixed . thanks..

    RESOLVED BY ME.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    I copied all of the files from parent directory to child because I want to edit all of them.

    That’s not a child theme.

    Start with the basics.

    Backup that whole /twentysixteen-child/ directory and then once you’ve done that and have that backup then delete all those files.

    I’m not kidding about the backup.

    Then in the now empty /twentysixteen-child/ directory create this one file.

    style.css

    In that file put the following lines, nothing else.

    /*
    Theme Name: Twenty Sixteen Child Theme
    Version: 0.1
    Template: twentysixteen
    */

    Now create a functions.php file and copy these lines into it.

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

    That’s all, just those 2 files with those few lines. Now activate the Twenty Sixteen Child Theme in your WordPress dashboard.

    This way when you look at the wp-content/themes/twentysixteen-child directory all you will see is these 2 files.

    style.css
    functions.php

    Once that’s done: what you you want to change?

    EDIT: OK, I’m glad you sorted it out. ??

    Thread Starter gameslopedy

    (@yiggory)

    Okay i will do your suggestion too.

    Deleting non-edited files from the current child theme…

    Because I added much more ads code into some files on child theme so I dont wanna lose them all.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Fatal Error Called Undefined function’ is closed to new replies.