Logo Showcase With Slick Slider Shortcode

Below, you’ll find a detailed guide on how to add the Logo Showcase With Slick Slider Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Logo Showcase With Slick Slider Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Logo Showcase With Slick Slider Plugin and the shortcodes it provides:

Plugin Icon
Logo Showcase with Slick Slider – Logo Carousel, Logo Slider & Logo Grid

"Logo Showcase with Slick Slider is a dynamic WordPress plugin offering logo carousel, slider, & grid features. It enables smooth, slick display of logos, enhancing your site's aesthetics."

★★★★✩ (7) Active Installs: 4000+ Tested with: 6.3.2 PHP Version: 5.4
Included Shortcodes:
  • [slick_logo_carousel]

Logo Showcase With Slick Slider [slick_logo_carousel] Shortcode

The ‘slick_logo_carousel’ shortcode from the Logo Showcase with Slick Slider plugin displays a carousel of logos. It accepts parameters for ‘id’ and ‘css_class’. It fetches the logos from a post with the given ‘id’. If the post is not valid or there are no logos, it returns the original content. If logos exist, it renders them in a slider or grid format.

Shortcode: [slick_logo_carousel]

Parameters

Here is a list of all possible slick_logo_carousel shortcode parameters and attributes:

  • id – Unique identifier for the logo showcase post
  • css_class – Custom CSS class for styling the logo carousel

Examples and Usage

Basic example – Showcases a logo carousel by referencing its ID.

[slick_logo_carousel id=3 /]

Advanced examples

Displays a logo carousel by referencing its ID and adding a custom CSS class.

[slick_logo_carousel id=3 css_class="my_custom_class" /]

Shows a logo carousel by referencing its ID and overriding the default display type.

[slick_logo_carousel id=3 display_type="grid" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [slick_logo_carousel] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'slick_logo_carousel', 'lswss_render_logo_showcase' );

Shortcode PHP function:

function lswss_render_logo_showcase( $atts, $content = '' ) {

	// Shortcode Parameters
	$atts = shortcode_atts(array(
		'id'		=> '',
		'css_class'	=> '',
	), $atts, 'slick_logo_carousel');

	// Return if no ID is passed
	if( empty( $atts['id'] ) ) {
		return $content;
	}

	// Validate Logo Showcase Post
	$showcase_post			= get_post( $atts['id'] );
	$showcase_post_type		= isset( $showcase_post->post_type ) 	? $showcase_post->post_type		: '';
	$showcase_post_status	= isset( $showcase_post->post_status )	? $showcase_post->post_status	: '';

	// Return if post is not valid
	if( $showcase_post_type != LSWSS_POST_TYPE || $showcase_post_status != 'publish' ) {
		return $content;
	}

	// Getting logo display type
	$prefix			= LSWSS_META_PREFIX;
	$display_type 	= get_post_meta( $atts['id'], $prefix.'display_type', true );
	$display_type	= ! empty( $display_type ) ? $display_type : 'slider';

	// Template Variables
	$atts['display_type']	= $display_type;
	$atts['images']			= get_post_meta( $atts['id'], $prefix.'gallery_id', true );

	// Return if no logo images are there
	if( empty( $atts['images'] ) ) {
		return $content;
	}

	ob_start();

	do_action( "lswss_render_logo_showcase_{$display_type}", $atts, $content, $showcase_post );

	$content .= ob_get_clean();
	return $content;
}

Code file location:

logo-showcase-with-slick-slider/logo-showcase-with-slick-slider/includes/shortcode/lswss-shortcodes.php

Conclusion

Now that you’ve learned how to embed the Logo Showcase With Slick Slider Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *