GET FREE VERSION GET THE PRO VERSION

Shortcodes

Overview of sharing buttons shortcodes.

In this article

Plugin comes with build-in shortcodes. In fact it is not necessarily to use them - plugin works with all images ( and not only images ) from your site no matter how there was added.

Display sharing buttons

Shortcode to display sharing buttons

Shortcode to display sharing buttons

For example, you need to place some sharing buttons to some custom place of your site. And you need to customize sharing content for this buttons.
In this case you can use shortcode. It can look like

[sti_buttons image="images/your-cool-image.jpg" url="http://your-link.com" title="Title for image" description="Description for image" buttons="facebook,twitter,linkedin"]

Shortcode has following parameters:

  • image ( required ) - url of image that will be displayed on page.
  • url ( optional ) - url of page that will be shared. Same as data-url attribute for non-shortcode use.
  • title ( optional ) - title for image that will be shared. Same as data-title attribute.
  • description ( optional ) - description for image that will be shared. Same as data-summary attribute.
  • buttons ( optional ) - sharing buttons to display. Default: facebook, twitter, linkedin.

It is also possible to use php version of this shortcode if you need to place it inside your theme source code. Just use:

if ( function_exists( 'sti_sharing_buttons' ) ) {
    sti_sharing_buttons( bool $echo = true, array $args = array() )
}

This function can be used with following parameters:

  • $echo (bool ) ( optional ) - return or print buttons html output
  • $args (array) ( optional ) - buttons settings. Accepts the same parameters as shortcode.

Display image with buttons

Shortcode to display sharing buttons with image

Shortcode to display sharing buttons with image

Shortcodes just gives you some choice how to add image to your page and how to set sharing content for it. Its looks like

[sti_image image="images/your-cool-image.jpg" shared_image="images/your-second-cool-image.jpg" shared_url="http://your-link.com" shared_title="Title for image" shared_desc="Description for image"]

As you see this shortcode has some additional parameters.

  • image ( required ) - url of image that will be displayed on page. If shared_image parameter not specified than its will also used as image that will be shared.
  • shared_image ( optional ) - url of image that must be shared. Same as data-media attribute if you doesn't use shortcode.
  • shared_url ( optional ) - url of page that will be shared. Same as data-url attribute for non-shortcode use.
  • shared_title ( optional ) - title for image that will be shared. Same as data-title attribute.
  • shared_desc ( optional ) - description for image that will be shared. Same as data-summary attribute.

You can also place this shortcode as php code. In this case you can add it to any place of your current WordPress theme.

echo do_shortcode( '[sti_image image="images/your-cool-image.jpg" shared_image="images/your-second-cool-image.jpg" shared_url="http://your-link.com" shared_title="Title for image" shared_desc="Description for image"]' );