• 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

Install jQuery

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 › Install jQuery

This topic is: resolved

Tagged: equeue jquery, jquery

  • This topic has 4 replies, 2 voices, and was last updated 9 years, 3 months ago by Ben Siegfried.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • December 13, 2013 at 4:08 pm #78911
    Ben Siegfried
    Member

    I'm trying to install the following jQuery and by all appearances to me it should work but I can't get it to work for some reason. Care to see what I may be doing wrong in installing it? The code below is actually not in the referenced site below; I'm working on a copy locally.

    Here is how I'm enqueueing it in the functions.php file:

    
    add_action( 'wp_enqueue_scripts', 'enqueue_headlinesubhead_script' );
    function enqueue_headlinesubhead_script() {
    
    	wp_enqueue_script( 'headline-subhead', get_stylesheet_directory_uri() . '/js/headline_subhead.js', array( 'jquery' ), '1.0.0', true );
    }
    

    Here's the jQuery in the headline_subhead.js file that I've placed in the /js directory.

    
    jQuery(document).ready(function($) {
        $(".headline, .subhead")
    		.fadeIn(3000);
    });
    

    It's for the headline/subhead text of the homepage, front and center.

    http://thekennedybook.com/marketingdev
    December 13, 2013 at 11:03 pm #78980
    Sridhar Katakam
    Participant

    Does that jQuery work as intended on a static HTML page?

    Implementation wise, I see no issues. You can view the source and see if the headline_subhead.js file is being loaded or not. I tested the same on a test site and it's fine. I constructed a simple HTML page to test, ensured that jQuery is working fine but fadeIn does not work. So it is a problem with the jQuery syntax/code itself rather than anything with WordPress and enqueuing.


    Genesis Tutorials | Follow me on Twitter

    December 14, 2013 at 10:13 am #79051
    Ben Siegfried
    Member

    Yes, here's where I got the jQuery from, the red text that pops in at the top of the page. I have modified it a bit for what I'm trying to seek through this post. http://bensiegfried.com/jquery/news.html

    December 14, 2013 at 10:51 am #79056
    Sridhar Katakam
    Participant

    Just add the following in your child theme's style.css and you will be good to go.

    .headline, .subhead {
    	display: none;
    }

    Genesis Tutorials | Follow me on Twitter

    December 14, 2013 at 10:57 am #79057
    Ben Siegfried
    Member

    Alright, thanks!

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 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