• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Enqueue error in Jessica Child Theme.

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Enqueue error in Jessica Child Theme.

This topic is: not resolved

Tagged: 404, enqueue scripts, enqueue styles, jessica, page not found

  • This topic has 3 replies, 3 voices, and was last updated 7 years, 3 months ago by carasmo.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • February 25, 2016 at 7:16 am #179875
    Nate
    Member

    Hey everyone.

    I'm having a bit of a pulling-my-hair-out moment:-). Good stuff!

    So, I'm trying to enqueue a few scripts and styles that are in the child theme, basically, a custom.js file and a few other things (fontawesome stylesheet, new compiled stylesheets, etc.)

    For all of them, I think I'm enqueueing them correctly, but if I view page source, and click on the <script> link, they come up 404-Page Not Found.

    Here's what I've got in the functions.php for the child theme:

    add_action( 'wp_enqueue_scripts', 'wsm_enqueue_assets' );
    /**
     * Enqueue theme assets.
     */
    function wsm_enqueue_assets() {
    	wp_enqueue_style( 'jessica', get_stylesheet_uri() );
    	wp_style_add_data( 'jessica', 'rtl', 'replace' );
    
    	wp_enqueue_script( 'custom-js', get_stylesheet_directory() . '/js/custom.js', array() );
    
    }

    http://akgoods.finchproservices.com/ is where the dev site is hosted.

    I'm working locally on VVV though. Could that have something to do with it?

    Thanks for any and all help with this. So weird because I feel like I enqueue scripts and styles all the time. I'm sure I'm missing something small and just need another set of eyes. Currently, I've got the js file loading to the head, which is where jessica loads one of its js files. I know that's not the best solution, but it's what I've got for now to move forward.

    Cheers,
    Nate


    Just getting started in this brave new Genesis world… Thanks in advance for all help:-).

    http://akgoods.finchproservices.com/
    February 25, 2016 at 3:55 pm #179920
    Victor Font
    Moderator

    When I view source, I can view the content of your files. They appear to be loading correctly. This is your custom.js:

    (function($) {
      $(document).ready(function() {
        //alert('Ready!');
      });
    }(jQuery));

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    February 25, 2016 at 5:27 pm #179926
    Nate
    Member

    Hey Victor,

    Thanks for the reply. Yes, it's loading now, but I'm using the get_header hook, as it was not loading when I used the wp_enqueue_scripts hook. I'd rather use the wp_enqueue_scripts hook, as I think that's best practice.

    Thanks!
    Nate


    Just getting started in this brave new Genesis world… Thanks in advance for all help:-).

    February 25, 2016 at 10:12 pm #179937
    carasmo
    Participant

    This is what I use, never had an issue.

    /** ====================================================================================
    
     * Register and Enqueue JS
    
    ==================================================================================== **/
    
    function christina_enqueue_register_scripts() {
    
    	//gist-async.min.js
    	wp_register_script('gist-async', CHILD_URL . '/lib/js/gist-async.min.js', array('jquery'), null, true);
    	wp_enqueue_script('gist-async');
    
    }
    
    add_action( 'wp_enqueue_scripts', 'christina_enqueue_register_scripts' ); 

    Genesis Theme Customization and Help

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble