Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter brian.c.welch

    (@briancwelch)

    Killing this post. It turns out my half hearted attempt to embed jQuery functions etc, was not at all best practices.

    I have since found that I needed to enqueue the jQuery scripts in a similar or same manor as enqueueing the style sheet for my child theme.

    In the end, in my functions.php file I had this code which appears to solve most of my issues. Only remaining issue is that in my custom jQuery, I am trying to create variables inside a document ready function and for some reason it’s not yet working.

    <?php
    function bbintra_adding_scripts() {
    	wp_register_script('brians_custom_styles', get_template_directory_uri() . '/style.css');
    	wp_register_script('brians_custom_scripts', get_stylesheet_directory_uri() . '/customizr-child-js-functions.js.php', array('jquery'));
    	wp_enqueue_script('brians_custom_scripts');
    	wp_enqueue_script('brians_custom_styles');
    }
    add_action( 'wp_enqueue_scripts', 'bbintra_adding_scripts' );
    ?>
Viewing 1 replies (of 1 total)