• 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

add javascript

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 › add javascript

This topic is: resolved

Tagged: jquery

  • This topic has 3 replies, 2 voices, and was last updated 6 years ago by famarinu.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • January 23, 2017 at 2:05 am #199838
    famarinu
    Member

    Hi, I should add this java script:

    <script type="text/javascript">
    $(document).ready(function() {
    $('#Leave_a_comment').click(function() {
    $('#comment_form_wrapper').show();
    });
    });
    </script>

    how do I add it?
    Thanks for your help.

    http://www.famarinu.com/ricette
    January 23, 2017 at 4:07 am #199843
    Brad Dalton
    Participant

    Look in the js folder of your theme to see how to code the jQuery file.

    You can then look in your functions file to see how to load the jQuery file.


    Get Help – Book Consultation.

    January 23, 2017 at 5:03 am #199847
    famarinu
    Member

    I try, but not working.
    Aniway, my theme is "Lifestyle pro".
    I want people clicked on "Click here to view the comments" to display comments.
    For make this I add in the functions.php. This:

           //* add a link
            add_filter( 'genesis_title_comments', 'sp_genesis_title_comments' );
            function sp_genesis_title_comments() {
    	$title = '<a href="#" ID="Leave_a_comment"><h3>Click here to view the comments<h3></a>';
    	return $title;
            }

    and this after "wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Droid+Sans:400,700|Roboto+Slab:400,300,700', array(), CHILD_THEME_VERSION );":

    wp_enqueue_script( '', get_bloginfo( 'stylesheet_directory' ) . '/js/comment.js', array( 'jquery' ), '1.0.0' );

    I have create also a comment.js

    jQuery(function( $ ){
    
        $(document).ready(function() {
                $('#Leave_a_comment').click(function() {
                    $('#comment-list').show();
                });
            });
     
    });

    And then I add in style.css this code:

    
    .comment-list {
        display: none;
    }

    But somethin not working 🙁

    January 24, 2017 at 1:16 am #199920
    famarinu
    Member

    I solved the problem. thank you

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘add javascript’ is closed to new 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