WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. brad_magnus
    Member
    Posted 8 months 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?

    http://wordpress.org/plugins/addthis-smart-layers/

  2. Srijith V
    AddThis Samurai
    Plugin Author

    Posted 8 months 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">
      addthis.layers({
        'theme' : 'light',
        'share' : {
          'position' : 'right',
          'numPreferredServices' : 3
        },
        'whatsnext' : {},
        'recommended' : {}
      });
    </script>
    <!-- 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
    Member
    Posted 8 months 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 Author

    Posted 8 months 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
    Member
    Posted 8 months 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!

Reply

You must log in to post.

About this Plugin

About this Topic