Displaying the Soliloquy slider anywhere in your theme is easy because it offers both a shortcode and PHP function.
Soliloquy Shortcode
Soliloquy PHP Function
You can paste the shortcode into any widget or content area and even add it to a custom function. This way you can hook the custom function in to any of your themes hooks.
Even if your theme doesn’t offer custom hooks, you can easily add them to your parent themes template files and use the custom hook in a function in your child theme with a conditional tag.
Another more popular method is to simply add the PHP code for the slider directly into your header template file.
On top of this, you can also add a conditional tag to the function like is_home() so your slider only outputs on your front page.
Lets take a look at adding the Soliloquy slider using different methods which work with different themes.
These 3 code snippets apply to using the Genesis theme framework with a Studio Press child theme.
This code displays the slider in the header on the home page only of any Genesis child theme using the sliders PHP tag.
This code displays the slider in the header sitewide.
This code displays the slider in the header on the home page only of any Genesis child theme using the shortcode.
Soliloquy Slider In Twenty Twelve Theme Header
You can display the slider in several header locations by adding the PHP function for Soliloquy into the header.php file.
Its advisable to copy this file from the parent theme and paste it into a child theme for Twenty Twelve so you don’t lose the function when the parent theme updates.
Always wrap the function in opening and closing PHP tags when you use PHP code in any themes template files.
Paste the PHP function or shortcode for the slider around line 42 in the header.php file in your child theme.
Display On Home or Front Page Only
To display the slider on the home page only, simply add a conditional tag to the code like this in your template file:
Or use this code of you have selected a static page to be displayed on the front page using the Reading Settings:
Don’t forget to change the slider i.d number in the code!
Twenty Twelve Default Header Size
You’ll notice the default header size is 960px x 260px.
You’ll need to crop your slider images to this size before you upload them if using the free version because it doesn’t resize or crop images.
Another option is to change the default header height in the twentytwelve/inc/custom-header.php file.
As you can see, the file includes support for flexible width and height so changing the value’s isn’t really necessary.
Note: Any code modifications should be made in the child theme rather than the parent themes files.
Genesis Slider Vs Soliloquy
The Soliloquy slider enables you to create and use unlimited sliders so each will display only the images you upload to that slider. On the other hand, the Genesis slider pulls the featured image from posts meaning you can only use it once or it displays the same images in multiple sliders.
Free Versus Premium Version
The premium version of Soliloquy is far superior to the free version in my opinion. One of the main reasons for this is the free version will NOT re-size or crop images to the dimensions you configure in the plugin settings. You’ll need to crop your images so they’re all the same size before you upload them unless you upgrade to the premium version.
Premium Version 10x Faster
The free version also displays small buttons which you cannot remove unless you edit the plugins core files.
If you’re looking for the best free slider plugin, i recommend Easing Slider Lite or Slide Deck which enables you to display custom content and video’s in your slider.
Learn how to add the Easing Slider in your header area on your home page only.
Was This Tutorial Helpful?