Skip Navigation

[Resolved] Shortcode inside layout

This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Noman 6 years, 10 months ago.

Assisted by: Noman.

Author
Posts
#613343

Hi , i am trying to use one of the social sharing plugin shortcode.

What aproach should i take ?
sample codes :

[et_social_follow icon_style="flip" icon_shape="rounded" icons_location="top" col_number="auto" counts="true" counts_num="0" total="true" outer_color="dark" network_names="true"]

i read the docs but it cover only for views.

#613426

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

shortcode.png

Hi,

Thank you for contacting Toolset support. Please insert shortcode in Content Template and then insert that Content Template within Layout:
https://toolset.com/documentation/user-guides/content-template-cell/

Thank you

#613548

HI Noman,

this is the instruction given

** Your generated shortcode is
[easy-social-share buttons="facebook,twitter,google,pinterest,linkedin,print,mail,love,more,whatsapp,telegram,subscribe,share" morebutton="1" morebutton_icon="plus" sharebtn_func="1" sharebtn_style="button" sharebtn_icon="share" sharebtn_counter="insidebeforename" counters=1 style="button" template="6" point_type="simple"]

**Include your shortcode into template files using this sample code
<?php echo do_shortcode('[easy-social-share buttons="facebook,twitter,google,pinterest,linkedin,print,mail,love,more,whatsapp,telegram,subscribe,share" morebutton="1" morebutton_icon="plus" sharebtn_func="1" sharebtn_style="button" sharebtn_icon="share" sharebtn_counter="insidebeforename" counters=1 style="button" template="6" point_type="simple"]'); ?>

To get the current post/page title and permalink you can use the following code:
$url = get_permalink($post->ID);
$title = get_the_title($post->ID);

A completed shortcode that uses those variables added will look like this:
<?php
$url = get_permalink($post->ID);
$title = get_the_title($post->ID);
echo do_shortcode('[easy-social-share buttons="facebook,twitter,google,pinterest,linkedin,print,mail,love,more,whatsapp,telegram,subscribe,share" morebutton="1" morebutton_icon="plus" sharebtn_func="1" sharebtn_style="button" sharebtn_icon="share" sharebtn_counter="insidebeforename" counters=1 style="button" template="6" point_type="simple" url="'.$url.'" text="'.$title.'"]');
?>

** Use your shortcode with the stored unique key inside content
[easy-social-share ukey="1517953080"]

** Use your shortcode with the stored unique key inside content
<?php echo do_shortcode('[easy-social-share ukey="1517953080"]'); ?>

pls advice, thanks.

#613617

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello,

You can use any type of shortcode in Content Template. If you need to use some php code then we can make small shortcode for it. Please insert easy social share shortcode in Content Template and let me know if you find any issue.

Thank you