Appending Markup to Slides in Soliloquy

This is a simple little snippet. On a project I’m working I had a need to include social share buttons with each item in a carousel slider.

Anyone who asks me knows that I’m a big fan of Soliloquy, from Thomas Griffin Media. I’m a fan because it’s a simple solution with some nifty add-ons and does what I need it to without too much fuss.

With the 2.x update Soliloquy added some filters to their plugin, making adding your own markup to your slides easier.

/* Filter to Append HTML to Slides
============================================= */
add_filter( 'soliloquy_output_slide', 'tgm_soliloquy_custom_html', 10, 4 );
function tgm_soliloquy_custom_html( $html, $id, $image, $data ) {

$slider_id = $data; // Get Slider ID
$slider_img= $image; // Optional; Getting Image URL from slider object

if ( '1937' != $slider_id ) return $html; // If the ID doesn't match...


My Review of Thrive Content Builder

Thrive Content Builder is a front end editor for WordPress. A tool like this is something valuable for all users. Why?¬†For me, I want to build a decent looking landing page that doesn’t take a lot of time to set up. For less experienced users, it’s a great way to feel empowered over their content. So I saw this mentioned in the Orange County WordPress Facebook Group. I jumped-in and figured it couldn’t be any worse than what’s already out there.

So what was I going to try to build? Something of a landing page like what we see below.

Screenshot 2014-04-28 16.54.18

So what’s the problem?

If you watch the video that Thrive Themes put out for their Content Builder, they hit on the reasons why existing page-builder plugins suck. Specifically…


Soliloquy Dynamic Slider for Current Post and Exclude an ACF Image ID

It’s not as though it was “really” a problem. But that I couldn’t figure it out caused me to lose sleep. I hate that shit.

So what was going on?
I am using Soliloquy along with the Dynamic Addon to automagically create sliders from attached images to the current post.

function digisavvy_dynamic_slider() {
	global $post;
	$dg_post_id = $post->ID;
	if ( function_exists( 'soliloquy_dynamic' ) ) soliloquy_dynamic( array( 'id' => "$dg_post_id" ) );

This snippet grabs the current post ID and stores it in the $dg_post_id variable. Nice.

The problem:
This pulled all the attached images for the current post, as expected. What I didn’t expect was that it pulled an image from an ACF (Advanced Custom Fields) image field I’d set up. Not cool. So I needed to exclude that image from getting pulled into the slider.

function digisavvy_dynamic_slider() {
global $post;

$imageArray = get_field('project_cover_image'); // Array returned by...


Justin Tadlock’s ‘Whistle’ Plugin…

I thought I’d share this useful little nugget of plugin wizardry, from Justin Tadlock called “Whistles,” which you can download here. What is/are Whistles? Whistles is a plugin that provides simple management and creation of Accordions, Tabs and Toggles. Most people like these features and make use of them on their WordPress sites. A lot of people (myself included at several points) have used plugins like “Styles with Shortcodes” or “All-in-One Shortcodes” to handle this. The problem with these plugins is that they tend to include a bazillion other shortcodes beyond what you actually need. Bah-hooey, I say!

## Is it any good? I think so. Instead of placing a bunch of content into your shortcodes…

Whistles you simply add ‘Whistles.’ And, really, Whistles are a kind of like…