• hi Matt
    I am using latest plugin and using newspaper theme 6.Thanks for previous response. A BIG THANK should given to you for this great and very important plugin from you. I am seriously looking to implement social code. can you please tell to be able to modify the code of beneath?
    this line of code:
    <?php echo "SHARING BUTTONS GO HERE"; ?>
    If that works, and you can see the words ‘SHARING BUTTONS GO HERE’ in your tabs, then you can replace it with this:
    <?php do_action(‘crafty-social-share-buttons’); ?>

    If i am not wrong please let me know where exact link of code i have to put to work perfectly.
    best regards
    Dr.rubel

    https://www.ads-software.com/plugins/squelch-tabs-and-accordions-shortcodes/

Viewing 1 replies (of 1 total)
  • Plugin Author Matt Lowe

    (@squelch)

    Hi iidob,

    I’m not sure I understand your question. It sounds like you’re asking how to put social sharing buttons inside of a tab? There are two possibilities depending on how/why you’re doing what you’re doing.

    Possibly the easiest option is to add a shortcode to display the social sharing buttons (if one doesn’t already exist). Then just used the shortcode inside of the tabs.

    Shortcode:

    function crafty_social_sharing_buttons_shortcode( $atts, $content, $tag ) {
        ob_start();
        do_action('crafty-social-share-buttons');
        return ob_get_clean();
    }
    add_shortcode( 'crafty_social_sharing_buttons', 'crafty_social_sharing_buttons_shortcode');

    Usage in the page:

    [tabs]
    [tab title="Tab 1"]
    [crafty_social_sharing_buttons]
    
    Tab 1 content
    [/tab]
    [tab title="Tab 2"]
    [crafty_social_sharing_buttons]
    
    Tab 2 content
    [/tab]
    [/tabs]

    The other options is if you want to use the tabs inside of a page template, you could use do_shortcode to execute the bits and pieces you want to generate:

    <?php ob_start(); ?>
    [tabs]
    [tab title="Tab 1"]
    <?php do_action('crafty-social-share-buttons'); ?>
    
    Tab 1 content
    [/tab]
    [tab title="Tab 2"]
    <?php do_action('crafty-social-share-buttons'); ?>
    
    Tab 2 content
    [/tab]
    [/tabs]
    <?php echo do_shortcode( ob_get_clean() ); ?>

    NOTE: I’ve not tested either of these blocks of code but they should give you an idea of direction.

Viewing 1 replies (of 1 total)
  • The topic ‘modifying code to input social button’ is closed to new replies.