• When I select to show the sharing widget for excerpts, 10 of them appear on the home page, but when that setting is off, even thought the “homepage” setting is turned on, there is no sharing widget.

    Is this a problem? If so, what’s the solution?

    Is there a function I can call in index.php to display the widget only once?

    https://www.ads-software.com/plugins/addthis/

Viewing 6 replies - 1 through 6 (of 6 total)
  • @galbaras:

    In the homepage it might be showing, the excerpt of your blog. That is why it is not showing the share buttons on your homepage.

    If is not the case please share your site url, so that we can debug the issue. If it’s in the development stage, you can send it to srijith[at]addthis.com

    If you need to manually add the widget(), you can put it in the header.php or footer.php file of your theme.

    Thread Starter Gal Baras

    (@galbaras)

    @srijithv, the home page only shows excerpts, so I guess the “homepage” setting only applies to “static” pages.

    Can you provide the exact PHP code for the theme? I’ve tried a few things and they didn’t work.

    Thanks again,
    Gal

    Hi Gal,

    You can put the following code to display your share buttons only in your home page:

    <?php if (is_home() || is_front_page()) echo addthis_print_widget(); ?>

    If you need to add buttons just after the header, you can put it in the index.php, after get_header();.

    Or if you need to add them in just before the footer, put the code in index.php just before <?php get_footer(); ?>.

    Thread Starter Gal Baras

    (@galbaras)

    Hi Srijith,

    This is getting somewhere, but it’s not taking into account my preferred settings. Also, from what I see, addthis_print_widget() takes a URL and a title.

    Can you please provide all of the code required to use the default plugin settings on the home page?

    Thanks again,
    Gal

    Thread Starter Gal Baras

    (@galbaras)

    OK, I looked at the code and figured it out.

    The full code in my case is:

    echo addthis_print_widget( esc_url( home_url() ), wp_title('',false), 'large_toolbox' );

    I got the value “large_toolbox” from the selected radio button on the plugin settings page. However, I would have expected the function to default to some plugin setting and use ‘addthis_style_default’ as a last resort.

    All good from my perspective, but please consider adding the ability to show the social widget on a blog page.

    Also, the function addthis_get_identifier() should probably use the current permalink and the current page title when $url and $title are null, instead of empty strings.

    Cheers,
    Gal

    Hi Gal,

    Will definitely look on to these.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Sharing widget not showing on homepage despite setting’ is closed to new replies.