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.

  • 2
    It might be helpful if you show us the code you are inserting. Oct 11, 2013 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, 2014 at 6:48
  • Which theme you are using? Dec 8, 2015 at 8:22

5 Answers 5


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/


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 do 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.

  if( function_exists( 'wowslider' ) ) {

Hope it has helped :)


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.

  • Please state your affiliation to this program. Nov 1, 2014 at 14:38
  • I'm not affiliated to them. It's a tool I found on the internet.
    – Vicki
    Nov 3, 2014 at 16:24
  • You should add that in an edit to your answer :-) Nov 3, 2014 at 16:51
  • I just tried and it wouldn't let me :)
    – Vicki
    Nov 5, 2014 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.


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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