Table of contents

  1. Introduction
  2. Method 1: replace post titles with image captions for a specific shortcode
  3. Method 2: replace post titles with image captions for all shortcodes

Introduction

Since plugin version 5.6.1 the Image Carousel shortcode uses post titles instead of image captions if the source is set to posts or taxonomy. Example:

[su_image_carousel source="posts: ..."]
[su_image_carousel source="taxonomy: ..."]

However, this behavior could be disabled. There are 2 methods available.

Method 1: replace post titles with image captions for a specific shortcode

Add the prefer_caption attribute to your shortcode:

[su_image_carousel source="posts: ..." prefer_caption="yes"]

Method 2: replace post titles with image captions for all shortcodes

Add the following snippet to the end of the functions.php file of your active theme:

add_filter( 'shortcode_atts_image_carousel', function( $out, $pairs, $atts, $shortcode ) {

	$out['prefer_caption'] = 'yes';

	return $out;

}, 10, 4 );