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:
"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."
- [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 showcaselayout
– Determines the layout type (carousel or grid)cg_title_show
– Controls whether to display the titlecg_title
– Sets the title of the logo showcaseheader_position
– Sets the position of the headerlcg_type
– Sets the logo ordering typetotal_logos
– Defines the total number of logos to displayc_theme
– Sets the theme for the carousel layoutauto_play
– Controls whether the carousel auto playsrepeat_product
– Controls whether the carousel loopsstop_hover
– Controls whether the carousel pauses on hoverc_desktop
– Sets the number of logos to display on desktopc_desktop_small
– Sets the number of logos to display on small desktopc_tablet
– Sets the number of logos to display on tabletc_mobile
– Sets the number of logos to display on mobileslide_speed
– Sets the speed of the carousel slidingslide_time
– Sets the delay between slidesscrol_direction
– Sets the direction of carousel scrollingnavigation
– Controls whether navigation buttons are displayednav_position
– Sets the position of navigation buttonscarousel_pagination
– Controls whether carousel pagination is displayedg_theme
– Sets the theme for the grid layoutg_columns
– Sets the number of columns in grid layoutg_columns_tablet
– Sets the number of columns in grid layout on tabletg_columns_mobile
– Sets the number of columns in grid layout on mobileimage_crop
– Controls whether the logo images are croppedimage_width
– Sets the width of the logo imagesimage_height
– Sets the height of the logo imagestarget
– Controls where the linked logos openimage_hover
– Controls whether the hover effect is applied to logostooltip
– 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.
Leave a Reply