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

Read more...