• 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

custom javascript not loading correctly

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 › Design Tips and Tricks › custom javascript not loading correctly

This topic is: not resolved

Tagged: javascript, jquery

  • This topic has 1 reply, 2 voices, and was last updated 8 years, 9 months ago by efuller.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • June 23, 2014 at 4:26 pm #111245
    katelsken
    Member

    When loading custom scripts to my page, my css works fine but not my javascript. In the source code it's loading fine, but nothing happens. I'm currently trying to customize the genesis-sample child theme .Here's a look at my code:

    add_action( 'wp_enqueue_scripts', 'sophie_styles' );
    
    function sophie_styles() {
    
        wp_enqueue_style( 
    
            'app_css', 
    
            CHILD_URL . '/stylesheets/app.css', 
    
            array(), 
    
            PARENT_THEME_VERSION 
    
        );
    
        wp_enqueue_style( 
    
            'style_css', 
    
            CHILD_URL . '/stylesheets/style.css', 
    
            array(), 
    
            PARENT_THEME_VERSION 
    
        );
    
    	
    	wp_enqueue_style( 
    
            'fonts_css', 
    
            CHILD_URL . '/fonts/style.css', 
    
            array(), 
    
            PARENT_THEME_VERSION 
    
        );
    
     wp_enqueue_script( 'sophie-responsive-menu', CHILD_URL . '/lib/js/responsive-menu.js', array( 'jquery' ), '1.0.0', true ); // Change 'prefix' to your theme's prefix
    
     
    }
    June 23, 2014 at 5:02 pm #111246
    efuller
    Member

    If you javascript file is being loaded correctly, then there must be a problem with your custom JS code?

    Have you checked the console in dev tools?

    Have a link we could check out?


    I am a web developer

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ 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