• matthewtimothy

    (@matthewtimothy)


    I am building my first theme and right now I am doing my homework on what to do. I would like to add a slider to the home page that I have already coded with jQuery. What are some ways I can implement this in my theme. I thought about adding it to the header but I would imagine that it would be in the header section within every page. Any advise or tutorials would be great.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Where are you trying to display it? If you are wanting to only in the front page you can use conditionals ( is_home() || is_front_page() ) to only do it on the home/index page.

    Thread Starter matthewtimothy

    (@matthewtimothy)

    yes I am just trying to display it on the index page. I was told to build the entire page as a regular site and then transfer everything over to a theme but I am stuck on the slider and some other areas. First theme is going to be interesting to say the least.

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Just wrap what you want to run inside those conditionals. So it would look something like:

    if ( is_home() || is_front_page() ) {
      // Code to run
      wp_enqueue_script ( 'my-slider' );
      echo '<div class="mySlider"></div>';
    }

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding a slider to my theme’ is closed to new replies.