WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I saw this Javascript feature tour file today, and was curious how I would go about implementing it on the homepage of a WordPress site.

Ideally, I'd like to add it so it only shows up if and only if a user is on the homepage and have never been there before. I'm new to this though, and I'm not sure how to implement it. I found this previous question but I'm not sure how I would use it in this context. How would I use it on the homepage, and what files would I have to edit?

share|improve this question
up vote 0 down vote accepted

You would enqueue it, this is how Javascript is added to WordPress properly. This function would typically go in your theme's functions.php or in a plugin.

function my_scripts_intro() {
         wp_enqueue_script( 'introjs','path to ..intro.js' );
         wp_enqueue_style( 'introcss','path to ..intro.css' );

add_action( 'wp_enqueue_scripts', 'my_scripts_intro' );

To determine the state of the visitor you would probably want to use cookies.

ps. This questions is very common please use the search.

share|improve this answer
Thanks for the information on enqueuing. If I added this code into the functions.php file, what file would I edit to call it on the homepage? – TRBS Mar 16 '13 at 5:54
This is what the code above does ....is_front_page ... link – Wyck Mar 16 '13 at 5:55
Gotcha. Thanks again. – TRBS Mar 16 '13 at 5:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.