WordPress.org

Ready to get started?Download WordPress

Forums

Smart Layers by AddThis
Shows on 404 but no other pages (14 posts)

  1. joelgoodman
    Member
    Posted 9 months ago #

    On this site, the share bar layer shows up on the 404 page, but not on any other page as far as I can tell.

    I don't even see the markup loading where it should at the end of the wp_footer(); output. Except for on the 404 page.

    1.0.2 of the plugin on WP 3.6.1

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

  2. jghes10
    Member
    Posted 9 months ago #

    I have exactly the same problem. It only appears on page 404

    1.0.2 of the plugin on WP 3.6.1

  3. Sol
    AddThis Samurai
    Plugin Author

    Posted 9 months ago #

    Hey guys, sorry you're having problems. Let's try to figure out what's causing the problems.

    @joelgoodman - what type of theme are you using? On your 404 page, there's a JS error that I think is causing the Share layer not to show up.

    @jghes - do you have a link to your site we could look at? And same question as above, what theme are you using?

  4. jghes10
    Member
    Posted 9 months ago #

    I deactivated SEO by Yoast. Now it worked in Opera, Chrome but not in IE and Firefox.

    My page: http://vernepleierportalen.no/

    Theme: http://www.woothemes.com/products/canvas/

  5. joelgoodman
    Member
    Posted 9 months ago #

    I'm a professional theme developer. Everything I do is hand-coded to the current WP specifications for theme development using modern WordPress functions and techniques. That said, this theme was built from scratch, by me.

    If you take a look, that js error that console is throwing is apart of the addThis script...

    </script><script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=de5052ebd24c66a8d2fe157b83e70a75"></script><script type="text/javascript">addthis.layers({
    theme : 'dark',
    share : {
        'position' : 'left',
        'services' : 'facebook,twitter,pinterest',
        //'numPreferredServices' : 5,
        'postShareTitle' : 'Thanks for sharing!',
        'postShareFollowMsg' : 'Follow us',
        'postShareRecommendedMsg' : 'Recommended for you'
    }
    mobile : {
        'buttonBarPosition' : 'bottom',
        'buttonBarTheme' : 'dark'
    }
    }
      );</script>

    The error is caused at mobile: { according to the console readout with an error of [Error] SyntaxError: Expected token '}' (404, line 108)

    And it doesn't even load the AddThis script and markup on other pages.

    Which I'm guessing is because you need a , after the share{} object...

  6. joelgoodman
    Member
    Posted 9 months ago #

    Well, so I figured that part of the error out -- Even if I switch back to WYSIWYG and save changes, if there was custom code left in the Advanced field, it will still load the "Advanced" custom code (that's bad practice).

    So now, you'll see it shows up on 404, but without the settings I've applied in the WYSIWYG settings (should be the dark theme, not transparent).

  7. Srijith V
    AddThis Samurai
    Plugin Author

    Posted 9 months ago #

    @joelgoodman: Unfortunately I cannot reproduce the issue in the themes I test with (mostly popular free themes). Do you have any additional steps which might lead to the issue?

    Also, there was another issue in saving the WYSIWYG settings and we have released a fixed version as of now(1.0.3). Can you verify your issue exists in this version?

  8. joelgoodman
    Member
    Posted 9 months ago #

    Well... the update throws a few errors when debug is on... I guess I have some digging to do in the code.

    Notice: Use of undefined constant ADDTHIS_SMART_LAYER_PRODUCT_CODE - assumed 'ADDTHIS_SMART_LAYER_PRODUCT_CODE' in /wp-content/plugins/addthis-smart-layers/addthis-smart_layers.php on line 12
    
    Notice: Use of undefined constant ADDTHIS_SMART_LAYER_AT_VERSION - assumed 'ADDTHIS_SMART_LAYER_AT_VERSION' in /wp-content/plugins/addthis-smart-layers/addthis-smart_layers.php on line 13
  9. joelgoodman
    Member
    Posted 9 months ago #

    I also get this notice in the WP Admin on activation:
    The plugin generated 530 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

  10. Srijith V
    AddThis Samurai
    Plugin Author

    Posted 9 months ago #

    @joelgoodman: The notice is due to the Notice getting printed. This shouldn't be the reason for the original issue mentioned. But thanks for pointing it out, it is fixed now and will be available from next release.
    Does the original issue still exist?

  11. joelgoodman
    Member
    Posted 9 months ago #

    Original issues exists, but since this is for a client, I've just gone and done it through wp_enqueue_scripts manually. And that's working fine. Still not sure what the issue is with the plugin.

  12. Srijith V
    AddThis Samurai
    Plugin Author

    Posted 9 months ago #

    @joelgoodman: I checked your site in Chrome and FF and the Share layer is showing up in home page and other pages. I assume it is now done through wp_enqueue_scripts. If you can provide an access to your dashboard, may be in a dev site, I can check and help you out. You can add srijith[AT]addthis.com as the user.

  13. joelgoodman
    Member
    Posted 9 months ago #

    Won't be able to today, too busy. Looked like the plugin wasn't properly printing through wp_footer(); originally. Not sure if something was hanging it up, or what, but I ran both the WP theme checker plugin and made sure debug wasn't throwing any errors and all came up clean for my theme.

    Manually writing the JSON object for the parameters and loading the addthis script via wp_enqueue scripts has worked for me, for now.

    It would be nice in the WYSIWYG to be able to choose some of the share buttons included, so I probably would have needed to use the Advanced panel to get at those anyway. At that point, I might as well just load it directly through my theme functions so I can control where and when it enqueues.

  14. Kristy0
    Member
    Posted 6 months ago #

    I'm having the same problem- the plug in is only showing up on the 404 page.

    I'm not a coder, is there an easy way to make the plug in work on the Theme Blvd- Stealth theme on my site: http://kristyoustalet.com

    Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.