Soliloquy Blog

WordPress slider tips, Tutorials and Resources.
how-to-add-a-homepage-slider-in-wordpress

How to Add a Homepage Slider in WordPress

by Waseem Abbas on July 5, 2022 | Reader Disclosure

Do you want to add a slider to your homepage? Plenty of WordPress themes don’t include one, and the themes that do usually give you very little control over how it looks or behaves.

We see this a lot when helping site owners: you want your best photos, products, or portfolio pieces front and center, and the theme just won’t cooperate. And the homepage is worth the effort — it’s the first thing most visitors see. The good news is that you don’t need to touch a line of code to add a slider there.

In this article, we’ll share how to add a homepage slider in WordPress using the Soliloquy plugin. We’ll cover the modern block editor method, plus the shortcode and template tag options for older setups.

To add a homepage slider in WordPress, you’ll need to follow these 3 steps:

  • Step 1: Install and activate the Soliloquy WordPress plugin
  • Step 2: Create your homepage slider
  • Step 3: Add the slider to your homepage with the Soliloquy block, a shortcode, or a template tag

Ready to get started? Let’s go!

Step 1: Install and Activate Soliloquy

The first thing you’ll need to do is install and activate the Soliloquy WordPress slider plugin. It’s built to be fast and beginner-friendly, so you can have a responsive homepage slider up in minutes.

If you need help with this step, then check out our guide on how to install Soliloquy.

Step 2: Create Your Homepage Slider

Once Soliloquy is active, go to Soliloquy » Add New from your WordPress admin to create your homepage slider.

Creating a new homepage slider on the Add New Soliloquy Slider screen in WordPress

Start by giving your slider a title so it’s easy to find later — something like “Homepage Slider” works well. Then drag and drop your images into the slider.

After adding your images, you can open the Configuration tab to adjust settings like the slider dimensions and transition. Once you’re happy with everything, hit the Publish button to save your slider.

Pro Tip: Homepage sliders look sharpest when every image is the same size. If your photos come out stretched or cropped oddly, see our guide on how to fix the image size for your slider in WordPress.

For more details on this step, check out our guide on how to create an image slider in WordPress.

Step 3: Add the Slider to Your Homepage

Now that your slider is published, it’s time to display it on your homepage. There are three simple ways to do that: the Soliloquy block, a shortcode, or a template tag.

Note: Not sure which method to pick? The Soliloquy block is the easiest option for adding the slider to your homepage content. The shortcode works anywhere you can paste text, and the template tag is best for theme areas like your header.

Method 1: Add the Slider With the Soliloquy Block

If you’re using the WordPress block editor, this is the easy way. Go to Pages and edit the page set as your homepage.

Then click the plus (+) icon to open the block inserter and search for “Soliloquy.”

Adding the Soliloquy block to a WordPress homepage from the block editor inserter

Click the Soliloquy block to insert it, then select the homepage slider you just created. Update the page, and your slider will appear on your homepage — no shortcodes or code required.

Need to change a slide later? See our guide on how to edit your slider content — updates apply everywhere the slider appears.

Method 2: Add the Slider With the Shortcode

Prefer a shortcode? Or are you using a page builder or the classic editor? From the edit screen of your homepage slider, simply copy the shortcode shown in the Soliloquy Slider Code box.

Copying the Soliloquy shortcode from the Soliloquy Slider Code box

Then, edit your homepage and paste the shortcode where you want the slider to appear. In the block editor, just add a Shortcode block and paste it there. Save the page, and your homepage slider is live.

Method 3: Add the Template Tag to Your Theme’s Template File

If you want your slider in a theme area instead of the page content — for example, an slider added without a shortcode — you’ll need the template tag.

First, edit your homepage slider and copy the template tag from the Soliloquy Slider Code box.

Copying the Soliloquy template tag from the Soliloquy Slider Code box

Then, paste the template tag into your theme’s header.php file (or whichever template file matches the spot you have in mind).

Pasting the Soliloquy template tag into a WordPress theme's header.php file

Warning: Changes to theme files like header.php are wiped out when your theme updates. We recommend making this edit in a child theme so your slider doesn’t disappear after the next update.

That’s it! Whichever method you picked, your homepage slider is now live and greeting every visitor who lands on your site.

Get Soliloquy Now

FAQs About Adding a Homepage Slider in WordPress

Does WordPress have a built-in homepage slider?

No, WordPress doesn’t include a slider by default. Some themes bundle their own homepage slider, but these are usually limited and stop working if you switch themes. A dedicated slider plugin like Soliloquy works with any theme and gives you full control over your slides.

How do I add a slider to my WordPress homepage without coding?

The easiest no-code route is the Soliloquy block. Create your slider, edit your homepage in the block editor, insert the Soliloquy block, and pick your slider from the list. Pasting the slider’s shortcode into your homepage works just as well and needs no code either.

Are homepage sliders bad for SEO?

Not when they’re built well. The real problems are oversized images and slow slider scripts that drag down your page speed, which is why we built Soliloquy to be lightweight. For a deeper look, see our guide on WordPress sliders and SEO.

Why isn’t my slider showing on my homepage?

The most common causes are a shortcode that didn’t paste completely, a caching plugin showing an old version of the page, or a plugin or theme conflict. Clearing your cache fixes it more often than you’d think. For step-by-step troubleshooting, see our guide on how to fix a WordPress slider that’s not working.

Can I show a slider on my homepage only?

Yes. If you add the slider to your homepage with the Soliloquy block or shortcode, it only appears on that page. If you’re using the template tag in a theme file like header.php, wrap it in the WordPress is_front_page() conditional so it loads on the homepage and nowhere else. It’s a one-line change, and any developer — or our support team — can help you add it.

And that’s a wrap — your homepage now leads with your best work. We hope this tutorial made adding a homepage slider in WordPress feel easy. If you’d like to keep sharpening your sliders, check out the following beginner-friendly guides:

author avatar
Waseem Abbas
Waseem Abbas is a content writer for SoliloquyWP and Envira Gallery.
Waseem Abbas is a content writer for SoliloquyWP and Envira Gallery.

Comments

    Michael

    May 3, 2017

    This is the best article from soliloquywp; and easy to understood

    Reply

      Waseem Abbas

      May 4, 2017

      Hey Michael, glad you like this article. 🙂 Do follow us on Facebook and Twitter for more free WordPress guides.

      Reply

    Matthias

    June 29, 2017

    Why dont you show WHERE to add the template tag. That’s the most important information of this article…and its missing. I am sorry, but explaining the obvious while not explaning the important things is not very helpful. You could say it is useless I guess.
    And why do you even upload an Image of the Header.php if the template tag isn’t in there? Just WHY?

    That is the information noobs like me need.

    Reply

      Waseem Abbas

      July 3, 2017

      Hello Matthias, you can add the template tag in header.php file where you want to display your image slider to the homepage. It is same with the shortcode. If you further need any assistance on where to place the template tag, then feel free to ask me here. 🙂

      Reply

        Ebony

        August 16, 2017

        Hi! Can you please explain step by step how to add this to the header.php file? I am not sure where to find it or add the shortcode.

        Reply

          Waseem Abbas

          August 19, 2017

          Hey Ebony, you can add the template tag in your header.php file at the place where you want to display the slider on homepage. Shortcodes are recommended for WordPress pages and posts.

          Reply

            Kait Vanosch

            January 20, 2019

            But how do we access the header file so we can make changes to it? Not every theme allows this?

    Kaung

    January 10, 2018

    I already have one homepage slider,but i did another slider and i want to change to new one without delecting old one…How can i do ?

    Reply

    Brenda Doro

    July 31, 2019

    I have the header.php file up and I inspected the elements on the page using just the google Inspect Element option, but I want the slider to come under my theme main menu. I can find the main menu. I inserted the code after all the s at the end of the code . But that’s just putting the code on the main page not the images that the code represents. Help!
    Thank you,
    Brenda

    Reply

Leave a Reply

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.