Forums » Fixing WordPress » Error in class-wp-hook.php

  • theohc



    First I’d like to inform you that I’m a complete wordpress and php beginner so my problem may seem easy to solve but I didn’t find the solution. I also want to notify you that I’m french so maybe you’ll find some mistakes.

    I wanted to create my first WordPress theme by myself so I followed a tutorial.
    It stated that to link bootstrap CSS and JS, I had to put this code in functions.php

    function theme_fairywren_fromscratch_scripts() {
    wp_deregister_script(‘jquery’ );
    wp_enqueue_script(‘jquery’, ‘’);
    wp_enqueue_script(‘bootstrapjs’, ‘’, array(‘jquery’), false, false);
    wp_enqueue_style(‘bootstrapcss’, ‘’);

    add_action( ‘wp_enqueue_scripts’, ‘theme_fairywren_fromscratch’ );

    But when I refresh my page (localhost/wordpress_fairywren), Wamp found this error:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘theme_fairywren_fromscratch’ not found or invalid function name in C:\wamp64\www\wordpress_fairywren\wp-includes\class-wp-hook.php on line 298

    What am I supposed to do? Maybe I need more PHP notions for this tutorial and I should follow an easier one?

    Thanks for reading and replying 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)


    Volunteer Forum Moderator

    Rather than building a theme from scratch, start with a good “starter” theme that’s designed to get you up and running quickly.

    I build almost all my sites from

    Thread Starter theohc


    Thank you for your answer! I tried to put the content of the compressed file in my localhost and got this error message:
    “Fatal error: Call to undefined function get_header() in C:\wamp64\www\ceciestuntest\index.php on line 15”
    Are there some other steps to follow with

    Moderator Steven Stern (sterndata)


    Volunteer Forum Moderator

    Unzip the file into wp-content/themes.

    Like any other theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error in class-wp-hook.php’ is closed to new replies.