How to add custom javascript to home page only?

Homepage Community Forums Aspire Theme Support How to add custom javascript to home page only?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #18549
    qvyang
    Customer

      I need to add some javascript to my home page. I only want to add it to my home page. How do I do this?
      I see from another post that I should be doing something like this:

      // Adds javascript
      add_action( 'genesis_meta', 'custom_javascript' );
      function custom_javascript() { ?>
      	Javascript goes here
      <?php
      }

      Which php file should I add this to?

      #18568
      Jason M
      Customer

        You can add that in your front-page.php file since that is the file used to display your homepage.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.