How to add this to child theme?

Hi,

i am building a guided tour through my Pro built site, and i need to enqueue some files for it.

I tried adding this to my child theme’s function.php, but it returns the error : Scrape nonce check failed. Please try again.??

function add_hs_scripts() {
  wp_enqueue_style( 'style', get_stylesheet_uri() );
 
  wp_enqueue_style( 'hopscotch', get_template_directory_uri() . '/css/hopscotch.css', array(), '1.1', 'all');
 
  wp_enqueue_script( 'script', get_template_directory_uri() . '/js/hopscotch.js', array ( 'jquery' ), 1.1, true);
 
    }
add_action( 'wp_enqueue_scripts', 'add_hs_scripts' );

Hello Tristan,

Instead of adding the code from the Wordpress admin area, please login through FTP then go to wp-content/pro-child then edit the functions.php and place the code from there.

As for the nonce error, that is more of an issue with your Wordpress core. Please check this link:

https://wordpress.org/support/topic/scrape-nonce-check-failed-please-try-again-when-editing-functions-php/

Hope this helps.

Thanks!

Will give it a try.

You’re welcome. Please note that we do not provide support for custom codes. If that does not work, please consult with a third-party developer.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.