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 am new to WordPress. Can you please suggest the steps to insert an image slider in my site's header? I don't know how to insert the code or where.

share|improve this question
It might be helpful if you show us the code you are inserting. – Charles Clarkson Oct 11 '13 at 6:38
Depending on your template, there should be a header.php or a variation thereof in the theme that you can change the code in and place an image slider via code or plugin. – Nina May 10 '14 at 6:48
Which theme you are using? – daniyalahmad Dec 8 '15 at 8:22

Depends on what theme you are using because some include hooks which make the job easier.

For themes which don't include hooks like Twenty Eleven & Twenty Twelve, you can simply past the PHP tag for the slider into the header.php file in the position you want your slider to display.

Example if using the free version of Soliloquy:

    <?php if ( function_exists( 'soliloquy_slider' ) ) soliloquy_slider( '007' ); ?>

Simply replace the 007 with the i.d for your slider which is generated once you create a new slide show.

If you only want to display your slider on the front page, add a conditional tag to the code like this:

   <?php if ( is_front_page() && function_exists( 'soliloquy_slider' ) ) soliloquy_slider( '007' ); ?>

Note: You should copy your parent themes header.php file to a child theme before adding the code for the slider otherwise you may lose it if you update the parent theme.

If your theme includes hooks, then you can add a custom function in your child themes functions.php file like this:

    function soliloquy_slider_header() {
    if ( function_exists( 'soliloquy_slider' ) ) soliloquy_slider( '007' );
    add_action('your_header_hook', 'soliloquy_slider_header');

Source: http://wpsites.net/best-plugins/add-soliloquy-slider-in-header-of-any-theme/

share|improve this answer

You generally do it by installing an image slider plugin and then using the plugin options to do that for you. Most of such plugins come with the shortcode options only, and not provide automatic slider addition to the other sections, so you have to do it manually.

To add stuff manually, one should have the basic knowledge of editing WordPress themes. Here is a small absolute-beginner-level how-to:

To add the slider in the header section of your site, you need to go to Appearance > Editor in your WordPress dashboard, then edit the header.php file, and finally add the code that is needed to display the slider.

For example, if you install Wowslider, you will need to add this bit of code in your theme's header.php.

<?php wowslider(1); ?>

Hope it has helped :)

share|improve this answer

Quite often, the easiest way of doing this is via a plugin (http://wordpress.org/plugins/search.php?q=slider&sort=) or via a built-in one in the theme.

Lots of modern themes have sliders built in that you can just adjust through the admin section (i.e. upload / resize the images you want) and then drop the 'shortcode' (i.e. [myslider]) on to your page.


share|improve this answer

You can embed this free image slider widget inside your web page. It's just a code you copy and paste into your page or anywhere you want to embed it. It's free and you can use it on unlimited pages.

share|improve this answer
Please state your affiliation to this program. – Pieter Goosen Nov 1 '14 at 14:38
I'm not affiliated to them. It's a tool I found on the internet. – Vicki Nov 3 '14 at 16:24
You should add that in an edit to your answer :-) – Pieter Goosen Nov 3 '14 at 16:51
I just tried and it wouldn't let me :) – Vicki Nov 5 '14 at 20:30

Maybe There is no option to add header slider more than 4 picts. But you can try to add a Siteorigin Slider widgets to the row then deactivate/hide the default header slider.

share|improve this answer

Create your own WordPress slideshow (you can customize as per your needs)

Download any JavaScript slidershow modules, such as: https://github.com/woothemes/FlexSlider

  • Create a custom post type called Slideshow (if you not familiar with custom post type, follow this: https://codex.wordpress.org/Post_Types documentation).
  • Add some dummy content to the content type (with title, descripion and featured image).

  • Add a function inside your functions.php file, write logic to fetch all posts under slideshow content type, iterate the items through the downloaded slideshow html.

  • Use a shortcode to retrieve data to view.

This is the basic steps to create a simple custom slideshow.

I hope this helps.

share|improve this answer

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.