Logo Showcase Ultimate Shortcode

Below, you’ll find a detailed guide on how to add the Logo Showcase Ultimate 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 Ultimate Plugin shortcode not to show or not to work correctly.

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

Plugin Icon
Logo Showcase Ultimate – Logo Carousel, Logo Slider & Logo Grid

"Logo Showcase Ultimate is a versatile WordPress plugin offering features like Logo Carousel, Logo Slider, & Logo Grid. Perfect for businesses wanting to display various logos in a dynamic and engaging manner."

★★★★☆ (26) Active Installs: 5000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [logo_showcase]

Logo Showcase Ultimate [logo_showcase] Shortcode

The Logo Showcase Ultimate shortcode is designed to create a dynamic and customizable logo display. It allows users to define logo layout, theme, image size, and hover effects.

Shortcode: [logo_showcase]

Parameters

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

  • id – Identifier of the logo showcase
  • layout – Determines the layout type (carousel or grid)
  • cg_title_show – Controls whether to display the title
  • cg_title – Sets the title of the logo showcase
  • header_position – Sets the position of the header
  • lcg_type – Sets the logo ordering type
  • total_logos – Defines the total number of logos to display
  • c_theme – Sets the theme for the carousel layout
  • auto_play – Controls whether the carousel auto plays
  • repeat_product – Controls whether the carousel loops
  • stop_hover – Controls whether the carousel pauses on hover
  • c_desktop – Sets the number of logos to display on desktop
  • c_desktop_small – Sets the number of logos to display on small desktop
  • c_tablet – Sets the number of logos to display on tablet
  • c_mobile – Sets the number of logos to display on mobile
  • slide_speed – Sets the speed of the carousel sliding
  • slide_time – Sets the delay between slides
  • scrol_direction – Sets the direction of carousel scrolling
  • navigation – Controls whether navigation buttons are displayed
  • nav_position – Sets the position of navigation buttons
  • carousel_pagination – Controls whether carousel pagination is displayed
  • g_theme – Sets the theme for the grid layout
  • g_columns – Sets the number of columns in grid layout
  • g_columns_tablet – Sets the number of columns in grid layout on tablet
  • g_columns_mobile – Sets the number of columns in grid layout on mobile
  • image_crop – Controls whether the logo images are cropped
  • image_width – Sets the width of the logo images
  • image_height – Sets the height of the logo images
  • target – Controls where the linked logos open
  • image_hover – Controls whether the hover effect is applied to logos
  • tooltip – Controls whether tooltips are displayed

Examples and Usage

Basic example – Displaying a simple logo showcase on your page.

[logo_showcase id="1" layout="carousel" /]

Advanced examples

Displaying a logo showcase with custom settings. This will display a grid layout of logos, with a custom title, tooltip on hover, and specific image dimensions.

[logo_showcase id="2" layout="grid" cg_title="Our Partners" tooltip="yes" image_width="200" image_height="200" /]

Displaying a logo showcase with more advanced carousel settings. This will display a carousel of logos that auto-plays, stops on hover, and scrolls in the right direction at a specified speed and time.

[logo_showcase id="3" layout="carousel" auto_play="yes" stop_hover="yes" scrol_direction="right" slide_speed="3000" slide_time="3000" /]

Displaying a logo showcase with advanced grid settings. This will display a grid of logos with a specific theme and number of columns for different devices.

[logo_showcase id="4" layout="grid" g_theme="grid-theme-2" g_columns="4" g_columns_tablet="3" g_columns_mobile="2" /]

PHP Function Code

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

Shortcode line:

add_shortcode("logo_showcase", array( $this, 'shortcode_create' ) );

Shortcode PHP function:

function shortcode_create( $atts, $content = null ) {
		ob_start();

        $atts = shortcode_atts( array(
            'id'    =>  '',
            'layout'            => "",
            'cg_title_show'     => "",
            'cg_title'          => "",
            'header_position'   => "",
            'lcg_type'          => "",
            'total_logos'       => "",
            'c_theme'           => "",
            'auto_play'         => "",
            'repeat_product'    => "",
            'stop_hover'        => "",
            'c_desktop'         => "",
            'c_desktop_small'   => "",
            'c_tablet'          => "",
            'c_mobile'          => "",
            'slide_speed'       => "",
            'slide_time'        => "",
            'scrol_direction'   => "",
            'navigation'        => "",
            'nav_position'       => "",
            'carousel_pagination'  => "",
            'g_theme'           => "",
            'g_columns'         => "",
            'g_columns_tablet'  => "",
            'g_columns_mobile'  => "",
            'image_crop'         => "",
            'image_width'        => "",
            'image_height'       => "",
            'target'             => "",
            'image_hover'        => "",
            'tooltip' => "",
        ), $atts );
        
        

        $this->lcg_enqueue_files();
        $post_id =  ! empty( $atts['id'] ) ? $atts['id'] : '';
        $lcg_value = get_post_meta( $post_id, 'lcg_scode', true );

        $data_encoded   = ( !empty($lcg_value) ) ? lcg()::adl_enc_unserialize( $lcg_value ) : array();
        extract( $data_encoded );
        $rand_id            = rand();
        $cg_title 			= ! empty( $cg_title ) ? $cg_title : '';
        $cg_title_show      = ! empty( $cg_title_show ) ? $cg_title_show : 'no';
        $lcg_type 			= ! empty( $lcg_type ) ? $lcg_type : 'latest';
        $layout   			= ! empty( $layout ) ? $layout : 'carousel';
        $c_theme  			= ! empty( $c_theme ) ? $c_theme : 'carousel-theme-1';
        $g_theme  			= ! empty( $g_theme ) ? $g_theme : 'grid-theme-1';
        $image_crop 		= ! empty( $image_crop ) ? $image_crop : "yes";
		$upscale		   	= ! empty( $upscale ) ? $upscale : "yes";
        $image_width 		= ! empty( $image_width ) ? $image_width : 185; // Image width for cropping
        $image_height 		= ! empty( $image_height ) ? $image_height : 119;
        $target				= ! empty( $target ) ? $target : '_blank';
        $c1_nav             = ! empty( $c1_nav ) ? $c1_nav : 'yes';
        $tooltip_show       = ! empty( $tooltip ) ? $tooltip : 'yes';
        $c1_nav_position    = ! empty( $c1_nav_position ) ? $c1_nav_position : 'top_right';
        $c2_nav             = ! empty( $c2_nav ) ? $c2_nav : 'yes';
        $g_columns          = ! empty( $g_columns ) ? intval( $g_columns ) : 6;
        $g_columns_tablet   = ! empty( $g_columns_tablet ) ? intval( $g_columns_tablet ) : 4;
        $g_columns_mobile   = ! empty( $g_columns_mobile ) ? intval( $g_columns_mobile ) : 2;

        $c_desktop          = ! empty( $c_desktop ) ? intval( $c_desktop ) : 5;
        $c_desktop_small    = ! empty( $c_desktop_small ) ? intval( $c_desktop_small ) : 4;
        $c_tablet           = ! empty( $c_tablet ) ? intval( $c_tablet ) : 3;
        $c_mobile           = ! empty( $c_mobile ) ? intval( $c_mobile ) : 2;

        $tooltip_posi       = ! empty( $tooltip_posi ) ? $tooltip_posi : "top";
        $total_logos        = ! empty( $total_logos ) ? intval( $total_logos ) : 12;

        //carousel settings
        $navigation                  = ! empty( $navigation ) ? $navigation : 'yes';
        $carousel_pagination         = ! empty( $carousel_pagination ) ? $carousel_pagination : 'no';
        $A_play                      = ! empty( $A_play ) ? $A_play : 'yes';
        $slide_speed                 = ! empty( $slide_speed ) ? $slide_speed : '2000';
        $slide_time                  = ! empty( $slide_time ) ? intval( $slide_time ) : '2000';
        $scrool                      = ! empty( $scrool ) ? $scrool : 'per_item';
        $repeat_product              = ! empty( $repeat_product ) ? $repeat_product : 'yes';
        $stop_hover                  = ! empty( $stop_hover ) ? $stop_hover : 'yes';
        $scrol_direction             = ! empty( $scrol_direction ) ? $scrol_direction : 'left';

        $image_hover     = ! empty( $image_hover ) ? $image_hover : 'yes';

        // shortcode $atts 
        $layout             			  = ! empty( $atts['layout'] ) ? $atts['layout'] : $layout;
        $cg_title_show              	  = ! empty( $atts['cg_title_show'] ) ? $atts['cg_title_show'] : $cg_title_show;
        $cg_title                         = ! empty( $atts['cg_title'] ) ? $atts['cg_title'] : $cg_title;
        $header_position 	   			  = ! empty( $atts['header_position'] ) ? $atts['header_position'] : 'middle';
        $lcg_type             		      = ! empty( $atts['lcg_type'] ) ? $atts['lcg_type'] : $lcg_type;
        $total_logos             		  = ! empty( $atts['total_logos'] ) ? $atts['total_logos'] : $total_logos;
        $c_theme             		      = ! empty( $atts['c_theme'] ) ? $atts['c_theme'] : $c_theme;
        $A_play             		      = ! empty( $atts['auto_play'] ) ? $atts['auto_play'] : $A_play;
        $repeat_product             	  = ! empty( $atts['repeat_product'] ) ? $atts['repeat_product'] : $repeat_product;
        $stop_hover             		  = ! empty( $atts['stop_hover'] ) ? $atts['stop_hover'] : $stop_hover;
        $c_desktop             		      = ! empty( $atts['c_desktop'] ) ? $atts['c_desktop'] : $c_desktop;
        $c_desktop_small             	  = ! empty( $atts['c_desktop_small'] ) ? $atts['c_desktop_small'] : $c_desktop_small;
        $c_tablet             		      = ! empty( $atts['c_tablet'] ) ? $atts['c_tablet'] : $c_tablet;
        $c_mobile             		      = ! empty( $atts['c_mobile'] ) ? $atts['c_mobile'] : $c_mobile;
        $slide_speed             		  = ! empty( $atts['slide_speed'] ) ? $atts['slide_speed'] : $slide_speed;
        $slide_time             		  = ! empty( $atts['slide_time'] ) ? $atts['slide_time'] : $slide_time;
        $scrol_direction             	  = ! empty( $atts['scrol_direction'] ) ? $atts['scrol_direction'] : $scrol_direction;
        $navigation             		  = ! empty( $atts['navigation'] ) ? $atts['navigation'] : $navigation;
        $carousel_pagination              = ! empty( $atts['carousel_pagination'] ) ? $atts['carousel_pagination'] : $carousel_pagination;
        $g_theme                            = ! empty( $atts['g_theme'] ) ? $atts['g_theme'] : $g_theme;
        $g_columns                          = ! empty( $atts['g_columns'] ) ? $atts['g_columns'] : $g_columns;
        $g_columns_tablet                   = ! empty( $atts['g_columns_tablet'] ) ? $atts['g_columns_tablet'] : $g_columns_tablet;
        $g_columns_mobile                   = ! empty( $atts['g_columns_mobile'] ) ? $atts['g_columns_mobile'] : $g_columns_mobile;
        $image_crop                         = ! empty( $atts['image_crop'] ) ? $atts['image_crop'] : $image_crop;
        $image_width                        = ! empty( $atts['image_width'] ) ? $atts['image_width'] : $image_width;
        $image_height                       = ! empty( $atts['image_height'] ) ? $atts['image_height'] : $image_height;
        $image_hover                        = ! empty( $atts['image_hover'] ) ? $atts['image_hover'] : $image_hover;
        $target                             = ! empty( $atts['target'] ) ? $atts['target'] : $target;
        $tooltip_show                       = ! empty( $atts['tooltip'] ) ? $atts['tooltip'] : $tooltip_show;

        $image_hover_effect = '';
        if( ! empty( 'yes' == $image_hover ) ) {
            $image_hover_effect = 'wpwax-lsu-hover-active';
        }
        
        if( 'carousel' == $layout ) {
            $theme = $c_theme;
        } else {
            $theme = $g_theme;
        }
        $box_shadow_class = '';
        if( 'carousel' == $layout && 'carousel-theme-3' == $theme ) {
            $box_shadow_class = 'wpwax-lsu-grid-theme-raised';
        }
        $args = array();
        $common_args = [
            'post_type' => 'lcg_mainpost',
            'posts_per_page'=> $total_logos,
            'status' => 'published',
        ];
        if ( 'latest' == $lcg_type ) { $args = $common_args; }
        elseif ('older' == $lcg_type) {
            $older_args = [
                'orderby'   => 'date',
                'order'     => 'ASC',
            ];
            $args = array_merge($common_args, $older_args);
        }else {
            $args = $common_args;
        }


        $adl_logo = new WP_Query( $args );

        $header_class = "";
        if( 'left' == $header_position ) {
            $header_class = 'wpwax-lsu-title--left';
        } elseif( 'right' == $header_position ) {
            $header_class = 'wpwax-lsu-title--right';
        }
        

        if ( $adl_logo->have_posts() ) { ?>

        <?php if( 'yes' == $cg_title_show ) { ?>
        <h4 class="wpwax-lsu-title <?php echo $header_class; ?>"><?php echo ! empty( $cg_title ) ? esc_html( stripslashes( wp_unslash( $cg_title ) ) ) : ''; ?></h4>
        <?php } ?>

            <div class="wpwax-lsu-ultimate <?php echo esc_attr( $image_hover_effect ); ?> wpwax-lsu-grid wpwax-lsu-<?php echo esc_attr( $theme ); ?> <?php echo ( 'grid' == $layout ) ? 'wpwax-lsu-logo-col-lg-' . esc_attr( $g_columns ) . ' wpwax-lsu-logo-col-md-' . esc_attr( $g_columns_tablet ) . ' wpwax-lsu-logo-col-sm-' . esc_attr( $g_columns_mobile ) . '' : 'wpwax-lsu-carousel wpwax-lsu-' . esc_attr( $theme ) . ' wpwax-lsu-carousel-nav-around'; ?> <?php echo esc_attr( $box_shadow_class ); ?>"
            <?php if( 'carousel' == $layout ) { ?>
                data-lsu-items      = "5"
                data-lsu-margin     = "20" 
                data-lsu-loop       = "<?php echo ( 'yes' == $repeat_product ) ? 'true' : 'false'; ?>" 
                data-lsu-perslide   = "1"
                data-lsu-speed      = "<?php echo esc_attr( $slide_speed ); ?>"
                data-lsu-autoplay   = '
                <?php if( 'yes' == $A_play ) { ?>
                {
                    "delay": "<?php echo esc_attr( $slide_time ); ?>",
                    "pauseOnMouseEnter": <?php echo ( 'yes' == $stop_hover ) ? 'true' : 'false'; ?>,
                    "disableOnInteraction": false,
                    "stopOnLastSlide": true,
                    "reverseDirection": <?php echo ( 'left' == $scrol_direction ) ? 'false' : 'true'; ?>
                }
                <?php } else { ?>
                    false
                <?php } ?>
                '
                data-lsu-responsive ='{
                    "0": {"slidesPerView": "<?php echo esc_js( $c_mobile ); ?>",  "slidesPerGroup": "<?php echo 'per_item' == $scrool ? '1' : esc_js( $c_mobile ); ?>", "spaceBetween": "15"}, 
                    "768": {"slidesPerView": "<?php echo esc_js( $c_tablet ); ?>",  "slidesPerGroup": "<?php echo 'per_item' == $scrool ? '1' : esc_js( $c_tablet ); ?>", "spaceBetween": "15"}, 
                    "979": {"slidesPerView": "<?php echo esc_js( $c_desktop_small ); ?>",  "slidesPerGroup": "<?php echo 'per_item' == $scrool ? '1' : esc_js( $c_desktop_small ); ?>", "spaceBetween": "20"}, 
                    "1199": {"slidesPerView": "<?php echo esc_js( $c_desktop ); ?>",  "slidesPerGroup": "<?php echo 'per_item' == $scrool ? '1' : esc_js( $c_desktop ); ?>", "spaceBetween": "30"}
                }'
            <?php } ?>
            >

                <div class="<?php echo ( 'grid' == $layout ) ? 'wpwax-lsu-content' : 'swiper-wrapper'; ?>">

                    <?php
                    while( $adl_logo->have_posts() ) : $adl_logo->the_post();
                        $tooltip  = get_post_meta( get_the_id(), 'img_tool', true );
                        $img_link = get_post_meta( get_the_id(), 'img_link', true );
                        $image_id = get_post_thumbnail_id();
                        $im = wp_get_attachment_image_src( $image_id, 'full', true );
                        //$img = aq_resize($im[0], $image_width, $image_height,true,true, $upscale);
                        $thumb = get_post_thumbnail_id();
                        // crop the image if the cropping is enabled.
                        if ( ! empty( $image_crop ) && 'no' != $image_crop ) {
                            $lcg_img = lcg_image_cropping( $thumb, $image_width, $image_height, true, 100 )['url'];
                        } else {
                            $aazz_thumb = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'large' );
                            $lcg_img = is_array( $aazz_thumb ) ? $aazz_thumb['0'] : array();
                        }
                    ?>

                    <?php

                    include LCG_PLUGIN_DIR . 'template/theme/' . $theme .'.php'; 

                    endwhile;
                    wp_reset_postdata();
                    ?>
        
                </div>
                <?php 
                if( 'carousel' == $layout && 'yes' == $navigation ) {
                    include LCG_PLUGIN_DIR . 'template/navigation.php'; 
                }
                if( 'carousel' == $layout && 'yes' == $carousel_pagination ) {
                    include LCG_PLUGIN_DIR . 'template/carousel-pagination.php'; 
                }
                
                ?>
            </div>

            <?php
                        
        }
		$true =  ob_get_clean();
		return $true;
	}

Code file location:

logo-showcase-ultimate/logo-showcase-ultimate/classes/lcg-shortcode.php

Conclusion

Now that you’ve learned how to embed the Logo Showcase Ultimate 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 *