Logo Slider WP Shortcodes

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

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

Plugin Icon
Logo Slider – Logo Carousel, Logo Showcase & Client Logo Slider WordPress Plugin

"Logo Slider is a versatile WordPress Plugin designed for showcasing logos. It features a carousel and client logo slider, making it the perfect tool to highlight your brand or business partners."

★★★★☆ (54) Active Installs: 20000+ Tested with: 6.2.3 PHP Version: false
Included Shortcodes:
  • [logo-slider-wp]
  • [lgxlogoslider]

Logo Slider WP [logo-slider-wp] Shortcode

The ‘logo-slider-wp’ shortcode is designed to display a customizable logo slider on your WordPress site. It pulls logo images from a specified category and arranges them based on set criteria. The shortcode allows you to define the order, size, autoplay settings, and appearance of the slider. It also provides options for responsiveness on different devices, and to customize the style of the slider.

Shortcode: [logo-slider-wp]

Parameters

Here is a list of all possible logo-slider-wp shortcode parameters and attributes:

  • target – Defines where to open the linked logo
  • ticker – Enables or disables the logo slider ticker functionality
  • order – Determines the order of the logos
  • orderby – Specifies the parameter to order the logos by
  • limit – Sets the maximum number of logos to display
  • hovertype – Sets the hover effect type for the logos
  • companyname – Decides whether to display the company name
  • companydesc – Decides whether to display the company description
  • maxheight – Defines the maximum height for the logos
  • maxwidth – Defines the maximum width for the logos
  • enbg – Enables or disables the background color
  • border – Enables or disables the border around the logos
  • bordercolor – Sets the color of the border around the logos
  • navposition – Sets the position of the navigation
  • cat – Sets the category of logos to display
  • bgcolor – Defines the background color of the slider
  • margin – Sets the margin around the logos
  • loop – Enables or disables looping of the logos
  • autoplay – Enables or disables autoplay of the logos
  • autoplay_timeout – Sets the time between each autoplay transition
  • autoplay_speed – Defines the speed of the autoplay transition
  • hover_pause – Decides whether to pause on hover
  • dots – Enables or disables the display of navigation dots
  • itemlarge – Sets the number of logos to display on large screens
  • itemdesk – Sets the number of logos to display on desktop screens
  • itemtablet – Sets the number of logos to display on tablet screens
  • itemmobile – Sets the number of logos to display on mobile screens
  • navlarge – Enables or disables navigation on large screens
  • navdesk – Enables or disables navigation on desktop screens
  • navtablet – Enables or disables navigation on tablet screens
  • navmobile – Enables or disables navigation on mobile screens

Examples and Usage

Basic example – Utilizing the shortcode to display a logo slider with default settings.

[logo-slider-wp /]

Advanced examples

Using the shortcode to display a logo slider with a specific category, order, and limit. This will display logos from the specified category, in the defined order, and limit the number of logos displayed.

[logo-slider-wp cat="tech" order="ASC" limit="10" /]

Using the shortcode to customize the appearance of the logo slider. This will display the logo slider with the defined maximum height and width, background color, and border color.

[logo-slider-wp maxheight="400" maxwidth="400" bgcolor="#f9f9f9" bordercolor="#cccccc" /]

Using the shortcode to display a logo slider with autoplay enabled and a custom autoplay speed. This will start the logo slider automatically on page load and set the speed at which the logos slide.

[logo-slider-wp autoplay="yes" autoplay_speed="1500" /]

Using the shortcode to display a logo slider with responsive settings. This will display a different number of logos on large desktop, desktop, tablet, and mobile screens.

[logo-slider-wp itemlarge="5" itemdesk="4" itemtablet="3" itemmobile="2" /]

PHP Function Code

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

Shortcode line:

add_shortcode('logo-slider-wp', array($plugin_public, 'logo_slider_wp_shortcode_function_dep' ));

Shortcode PHP function:

function logo_slider_wp_shortcode_function_dep($atts) {

        $cats_set       = $this->settings_api->get_option('logosliderwp_settings_cat', 'logosliderwp_adv', '');

        $order_set      = $this->settings_api->get_option('logosliderwp_settings_order', 'logosliderwp_basic', 'DESC');

        $orderby_set    = $this->settings_api->get_option('logosliderwp_settings_orderby', 'logosliderwp_adv', 'orderby');

        $limit_set      = $this->settings_api->get_option('logosliderwp_settings_limit', 'logosliderwp_adv', -1);


        $max_height          = intval($this->settings_api->get_option('logosliderwp_settings_height', 'logosliderwp_basic', 350));
        $max_width           = intval($this->settings_api->get_option('logosliderwp_settings_width', 'logosliderwp_basic', 350));

        $compnayanme_set     = trim($this->settings_api->get_option('logosliderwp_settings_show_company', 'logosliderwp_basic', 'no'));
        $compnaydesc_set     = trim($this->settings_api->get_option('logosliderwp_settings_show_company_desc', 'logosliderwp_basic', 'no'));



        //Data Attribute
        $margin_set     = trim($this->settings_api->get_option('logosliderwp_settings_margin', 'logosliderwp_config', 10));

        $loop_set       = $this->settings_api->get_option('logosliderwp_settings_loop', 'logosliderwp_config', 'yes');

        $autoplay_set   = trim($this->settings_api->get_option('logosliderwp_settings_autoplay', 'logosliderwp_config', 'yes'));


        $autoplay_timeout_set = intval($this->settings_api->get_option('logosliderwp_settings_autoplay_timeout', 'logosliderwp_config', 2000));

        $autoplay_speed_set  = intval($this->settings_api->get_option('logosliderwp_settings_autoplay_slidespeed', 'logosliderwp_config', 1000));


        $hover_pause_set  = $this->settings_api->get_option('logosliderwp_settings_hover_pause', 'logosliderwp_config', 'no');

        $dots_set         	= trim($this->settings_api->get_option('logosliderwp_settings_dots', 'logosliderwp_config', 'yes'));


        // Responsive
        $item_set_lagedesctop   = $this->settings_api->get_option('logosliderwp_settings_largedesktop_item', 'logosliderwp_responsive', 5);
        $nav_set_lagedesctop   =  $this->settings_api->get_option('logosliderwp_settings_desktop_nav', 'logosliderwp_responsive', 'yes');

        $item_set_desctop    = $this->settings_api->get_option('logosliderwp_settings_desktop_item', 'logosliderwp_responsive', 4);
        $nav_set_desctop     =  $this->settings_api->get_option('logosliderwp_settings_desktop_nav', 'logosliderwp_responsive', 'yes');

        $item_set_tablet    = $this->settings_api->get_option('logosliderwp_settings_tablet_item', 'logosliderwp_responsive', 3);
        $nav_set_tablet    =  $this->settings_api->get_option('logosliderwp_settings_tablet_nav', 'logosliderwp_responsive', 'yes');

        $item_set_mobile   = $this->settings_api->get_option('logosliderwp_settings_mobile_item', 'logosliderwp_responsive', 2);
        $nav_set_mobile    =  $this->settings_api->get_option('logosliderwp_settings_mobile_nav', 'logosliderwp_responsive', 'yes');



        //Style
        $bgcolor_set    	= trim($this->settings_api->get_option('logosliderwp_settings_bgcolor', 'logosliderwp_style', '#f1f1f1'));
        $bordercolor_set     = trim($this->settings_api->get_option('logosliderwp_settings_bordercolor', 'logosliderwp_style', '#f1f1f1'));
        $enbg_set            =  $this->settings_api->get_option('logosliderwp_settings_bgcolor_en', 'logosliderwp_style', 'no');
        $border_set       	 =  $this->settings_api->get_option('logosliderwp_settings_border_en', 'logosliderwp_style', 'no');
        $navposition_set      =  $this->settings_api->get_option('logosliderwp_settings_nav_position', 'logosliderwp_style', 'b-center');
        $hovertype_set        =  $this->settings_api->get_option('logosliderwp_settings_hover_type', 'logosliderwp_style', 'default');


        $atts = shortcode_atts(array(
            'target'            => '_blank',
            'ticker'            => 'no',
            'order'            => esc_attr($order_set),
            'orderby'          => esc_attr($orderby_set),
            'limit'            => esc_attr($limit_set),
            'hovertype'        => esc_attr($hovertype_set),
            'companyname'      => esc_attr($compnayanme_set),
            'companydesc'      => esc_attr($compnaydesc_set),
            'maxheight'        => esc_attr($max_height),
            'maxwidth'         => esc_attr($max_width),
            'enbg'             => esc_attr($enbg_set),
            'border'           => esc_attr($border_set),
            'bordercolor'      => esc_attr($bordercolor_set),
            'navposition'      => esc_attr($navposition_set),
            'cat'              => esc_attr($cats_set),
            'bgcolor'          => esc_attr($bgcolor_set),
            'margin'           => esc_attr($margin_set),
            'loop'             => esc_attr($loop_set),
            'autoplay'         => esc_attr($autoplay_set),
            'autoplay_timeout' => esc_attr($autoplay_timeout_set),
            'autoplay_speed'   => esc_attr($autoplay_speed_set),
            'hover_pause'      => esc_attr($hover_pause_set),
            'dots'             => esc_attr($dots_set),
            'itemlarge'        => esc_attr($item_set_lagedesctop),
            'itemdesk'         => esc_attr($item_set_desctop),
            'itemtablet'       => esc_attr($item_set_tablet),
            'itemmobile'       => esc_attr($item_set_mobile),
            'navlarge'         => esc_attr($nav_set_lagedesctop),
            'navdesk'          => esc_attr($nav_set_desctop),
            'navtablet'        => esc_attr($nav_set_tablet),
            'navmobile'        => esc_attr($nav_set_mobile),
        ), $atts, 'logo-slider');

        $output = $this->lgx_output_function_dep($atts);

        return $output;
    }

Code file location:

logo-slider-wp/logo-slider-wp/includes/class-logo-slider-wp.php

Logo Slider Wp [lgxlogoslider] Shortcode

The ‘lgxlogoslider’ shortcode from Logo Slider WP plugin is used to display a logo slider. This shortcode takes ‘id’ as a parameter, which is the ID of the showcase you want to display. If the ‘id’ is not set or invalid, it returns an error message. If the ‘id’ is valid, it retrieves the showcase data and displays it.

Shortcode: [lgxlogoslider]

Parameters

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

  • id – The unique identifier for the logo slider showcase

Examples and Usage

Basic example – A simple usage of the lgxlogoslider shortcode where we specify the ID of the logo slider we wish to display.

[lgxlogoslider id=3 /]

Advanced examples

There are no other attributes available for this shortcode other than ‘id’. However, you can use the same shortcode multiple times on the same page with different IDs to display different logo sliders. Here is an example:

[lgxlogoslider id=3 /]
[lgxlogoslider id=4 /]
[lgxlogoslider id=5 /]

This will display three different logo sliders on the same page, each with a different set of logos based on the specified IDs.

Remember, the ‘id’ attribute in the shortcode should correspond to the ID of the logo slider that you have created in your WordPress dashboard. If the specified ID does not exist, it will display an error message.

PHP Function Code

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

Shortcode line:

add_shortcode('lgxlogoslider', array( $this, 'display_lgx_logo_slider' ) );

Shortcode PHP function:

function display_lgx_logo_slider($atts) {
        if ( ! isset( $atts['id'] ) ) {
            return '<p style="color: red;">Error: The showcase ID is missing. Please add a Showcase ID.</p>';
        } else {
            $lgx_shortcodes_meta = get_post_meta( $atts['id'], '_lgx_lsp_shortcodes_meta', true );

            if(empty($lgx_shortcodes_meta)) {
                return '<p style="color: red;">Error: The showcase ID is not valid. Please add a valid Showcase ID.</p>';
            }
            //echo '<pre>';print_r($lgx_shortcodes_meta['showcase_type']);echo '</pre>';
            $lgx_lsw_loading_icon = plugin_dir_url( __FILE__ ). 'assets/img/loader.gif';
            ob_start();
            include('partials/view-controller.php');
            return ob_get_clean();
        }
    }

Code file location:

logo-slider-wp/logo-slider-wp/public/class-logo-slider-wp-public.php

Conclusion

Now that you’ve learned how to embed the Logo Slider Wp Plugin shortcodes, 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 *