Support » Plugin: AddToAny Share Buttons » Breaks site feed

  • Resolved Greenweb

    (@greenweb)


    I had the following issue:

    XML Parsing Error: junk after document element
    Location: http://www.website.com/feed/
    Line Number 6, Column 1:<?xml version=”1.0″ encoding=”UTF-8″?>

    The plugin is adding the following above the opening xml tag:

    <script type="text/javascript"><!--
    wpa2a.targets=[];
    wpa2a.html_done=true;if(wpa2a.script_ready&&!wpa2a.done)wpa2a.init();wpa2a.script_load();
    //--></script>
    <?xml version="1.0" encoding="UTF-8"?>

    I fixed by adding the following: if(is_feed()) return; into the function A2A_SHARE_SAVE_footer_script()

    It would be great if this could be added into the plugin on the next update. I’ll hang off on any updates until the issue is addressed.

    Thanks for the great plugin. 😀

    https://wordpress.org/plugins/add-to-any/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author micropat

    (@micropat)

    By defualt, this doesn’t happen because wp_footer isn’t loaded for the feed, but I can see some other plugin or theme changing this behavior. Can you pinpoint what’s causing wp_footer to load?

    Regardless, thanks for sharing. The is_feed conditional will be rolled into the next release.

    I’m using theme twentyeleven and the AddToAny buttons aren’t going into the footer but at the end of entry-content div. That causes the buttons to appear on feeds. The feeds are in use in mobile software to read blog posts and the buttons break the layout.

    Is there another way to get those buttons in footer than modifying / adding a child theme to it?

    EDIT: I updated the plugin this morning to version 1.0.2 but that had no effect

    Well, I guess this is basically a problem with JSON API while that doesn’t return true for is_feed() (so I’m not using a regular feed). I’ll try to figure out a workaround without having to modify the theme.

    @micropat thanks for the update – works great.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Breaks site feed’ is closed to new replies.