Home / Forums / ePix Support / Facebook Follow Shortcode in sidebar text widget

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts

  • DeependraSingh
    Participant

    I added the following piece of code in functions.php to use facebook subscribe shortcode in the text widget.
    I also added the follwoing line to make it work in the text widget but nothing appears:
    add_shortcode(‘fbsubscribe’, ‘facebookSubscribe’);

    // Code
    function facebookSubscribe($atts) {
    extract(shortcode_atts(array(
    'profileurl' => 'http://www.facebook.com/deependra.singh.chauhan',
    /* Leave height/width blank for default */
    'height' => '35',
    'width' => '225',
    'color' => 'light',
    'layout' => 'button',
    'showfaces' => 'false',
    'kids' => 'false'
    ), $atts));

    $return = '<div class="fb-follow" data-href="' . $profileurl . '" data-width="' . $width . '" data-height="' . $height . '" data-colorscheme="' . $color . '" data-layout="' . $layout . '" data-show-faces="' . $showfaces . '" kid_directed_site="' . $kids . '"></div><br><br>';
    return $return;
    }

    add_filter('widget_text', 'do_shortcode');
    add_shortcode('fbsubscribe', 'facebookSubscribe');

    Please help.


    DeependraSingh
    Participant

    I am using the shortcode [fbsubscribe] to render the subscribe button in the text widget.


    Tom ( Support)
    Keymaster

    Hi,

    Why do you have to add code to the functions.php? This isn’t normally how a plugin works. You should be able to install the plugin then use the shortcode.

    I recommend testing this with the standard WP theme to see if it works. If not, then this is not a theme issue.

    Kind regards,
    Tom

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.