How to create custom displays/positions for share buttons (and how to use them – shortcode, function Call, Elementor widget, Block Editor)?

Article sections

    Overview

    Creating a custom display or position is a unique function of Easy Social Share Buttons for WordPress. The idea behind this is to become a full replacement of the typical shortcode for the share buttons.

    Even that in Easy Social Share Buttons for WordPress you have 30+ display positions sometimes you may need a different type of integration. Till now those integrations are done with a shortcode embed in the template of a builder or directly in the theme code (or function call).

    This method of integration has 3 major cons that most of the users have faced:

    • A change in the style is required to open the template or theme file and modify the shortcode. That is even more annoying if you have used it several times.
    • If you decide to temporarily stop the display you should edit the template or theme files.
    • The shortcode can be limited in supported options.

    The custom display function is made to solve or those problems at once. You can create a custom display that can be embedded anywhere using function call, shortcode, Elementor widget, Block Editor element. This custom display goes automatically in the positions menu. This means that you can stop or activate it as you do for other methods. And you have all granular controls for design optimizations.

    If the menu is missing on your installation the function should be enabled via the activate/deactivate features.

    Create and Manage Custom Display / Position

    The list of custom display/positions you can find in Where to Display -> Custom Display / Positions.

    If you need to create a new display simply press the “Add New Custom Display/Position” button and fill your name. When you confirm the form the new display will appear automatically in the list and it will also appear automatically in display positions of the plugin.

    Using Custom Display/Position on Site

    No matter of integration type you choose unless the force to show option is provided you should enable the display position from the menu. Otherwise, you won’t see share buttons appearing.

    Shortcode / Function Call

    On the list of custom positions, you will find quick instructions for adding each of the displays inside content or code when you are using shortcode or function call.

    Shortcode

    To add the display anywhere inside the content you have a shortcode [ social-share-display ] that can be used – you can use copy/paste.

    Shortcode Arguments
    Argument Description
    design Custom display/position ID
    force Always showDisplay the custom display/position even when the position is not marked as active in the Where to Display menu.Possible values

    • no
    • yes

     

    archve Archive templateSet to Yes if you include this code in an archive template to make it share correct information.Possible values

    • no
    • yes

     

    custom Custom share detailsSet to Yes to use the possible custom share parameters.Possible values

    • no
    • yes

     

    url Custom share URL
    message Custom share message
    image Custom share image
    tweet Custom tweet
    jetengine Only if you are using the shortcode in JetEngine Listing template. The option is made to collect the correct post sharing information.Possible values

    • no
    • yes

     

    Function Call

    You also have a ready function call snippet for your theme that you can use with copy/paste.

    <?php if (function_exists("essb_custom_position_draw")) { essb_custom_position_draw(positionID, alwaysShow); } ?>
    The parameters for custom share details (URL, message, and image) can be used only with a shortcode or function call. The customization of the sharing should be used in combination with the social media optimization tags because not all networks will use all of those options. Most of the networks will refer to the URL only and follow the social media optimization tags on that URL.

    Elementor Page Builder

    If you are using Elementor Page builder there is a dedicated widget that you can use to add a specific custom display/position anywhere in content or Elementor template.

    Block Editor

    Hint! Remember that usage of custom position without the force option will require to activate display form the positions for social share buttons display. If you use the force option, share buttons will always appear no matter the active state of this position on site.

    Have more questions? We’re more than happy to assist.
    in Showing share buttons on the website
    Was this article helpful?
    YesNo
    Have more questions? We’re more than happy to assist.