Smart Layers by AddThis
[resolved] Don't show on home page (5 posts)

  1. brad_magnus
    Posted 2 years ago #

    Is there a way to not have the share buttons show up on the home page? I don't think many people are likely to share that page, it looks a little out of place there. I didn't see any settings for that? Can I adjust the plugin to ignore the home page?


  2. Srijith V
    AddThis Samurai
    Plugin Contributor

    Posted 2 years ago #

    @brad_magnus: This is one feature we are planning to introduce in the plugin soon. As of now, the plugin doesn't have such a feature. You may however use the configuration code from addthis.com/get/smart-layers and place it in your theme file to handle this. If your theme have support for customising widgets, easiest way is to place it in a widget which wont show in the home page. If you are comfortable in touching the theme file, you may place the following code in the footer.php right after </body> in your theme folder.

    <?php if ( ! is_home() ) {?>
    <!-- AddThis Smart Layers BEGIN -->
    <!-- Go to http://www.addthis.com/get/smart-layers to customize -->
    <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=REPLACE_WITH_YOUR_PUB_ID"></script>
    <script type="text/javascript">
        'theme' : 'light',
        'share' : {
          'position' : 'right',
          'numPreferredServices' : 3
        'whatsnext' : {},
        'recommended' : {}
    <!-- AddThis Smart Layers END -->
    <?php } ?>

    Go to http://www.addthis.com/get/smart-layers to customize the JS code to be used.

  3. brad_magnus
    Posted 2 years ago #

    @srijith.v For various reasons, I have a footer_home. Adding the above code doesn't hide the it on the home page though. Doesn't that add it?

    Maybe the best plan then is to use the code from your site, add it to the footer, and leave footer_home blank? Is that how the code works?

  4. Srijith V
    AddThis Samurai
    Plugin Contributor

    Posted 2 years ago #

    @brad_magnus: It might not work properly if are having a static front page. You may try changing the first line to

    <?php if ( ! is_home() && !is_front_page() ) {?>

    to handle this. Again, this might not work if the theme is not properly structured. If you are sure that footer.php is not loaded into the home page, you can place code from Addthis.com there.

    I can help you with this if you let me know the theme you are using. You may send it to srijith[AT]addthis.com

  5. brad_magnus
    Posted 2 years ago #

    Thanks @srijith.v! I do have a static front page. I'm building a custom theme based on Reverie: http://themefortress.com/reverie/ and I'm pretty sure that I've got things set up correctly. I might just go for the code from addthis.com, though since even though I added that code to the footer_home.php it's still visible on the home page.

    I'll email you if I can't get that to work properly. Thanks for being so willing to help out!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Smart Layers by AddThis
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic