• So, after hours and HOURS of trying to make it happen, I finally got the Shareaholic share buttons to appear in a modal window that gets its contents from an AJAX call.

    WARNING: My solution is very, very hacky, but seems to work for the most part. So, it’s likely this is entirely my fault and there’s just nothing that can be done about it.

    I have the plugin installed on my main site and I have things connected to shareaholic.com to get metrics, run reports, that kind of thing. I created a new location for the modal window buttons on the Shareaholic site and gave them some custom styling. Since (as near as I can tell, shortcodes aren’t able to be pulled into AJAX calls very easily, if at all), I kind of had to hack things together. As near as I could tell, all the shortcode did, really was out put an empty div with some data- attributes assigned to it, so that’s what I did:

    $return .= '<div class="shareaholic-canvas" data-app="share_buttons" data-app-id="12345678" data-summary="summary stuff"></div>';

    Still nothing appeared in the modal window, so using the advice here, I was able to add this code as well:

    $return .= '<script type="text/javascript">Shareaholic.init_apps()</script>';

    And that seems to work. Share buttons get pulled into the modal and I’m able to share just fine. The only problem is, it doesn’t seem to recognize my custom location styling that I set up on shareaholic.com and looks to be just displaying the default share buttons (with “Sharing is Caring”).

    Any idea why this is? I would have thought that the data-app-id attribute would take care of that, especially considering, my account id is already established on the parent page.

    Like I said, this is a very hacky solution to my problem, but I thought I would at least put it out there to see if anyone had any suggestions of things to try to get the custom buttons pulled in there. Any help provided would be much appreciated. Thanks!

    https://wordpress.org/plugins/sexybookmarks/

Viewing 1 replies (of 1 total)
  • Thread Starter B1gJ4k3

    (@b1gj4k3)

    OK, so it now appears the problem is that my site can’t connect with the Shareaholic site to get the custom data to display those buttons in the way that I want them. I put it a straight up shortcode for the custom buttons on a normal page and got the same result, so this doesn’t appear to be related to the modal window.

    Could my multisite network installation be a problem? I tried to add the new domain (subdomain.mydomain.com) to my Shareaholic account and was unable to verify it. Does it have to be a complete separate domain (and not a sub)?

Viewing 1 replies (of 1 total)
  • The topic ‘Wrong (possibly default) icon styles displaying in AJAX modal window?’ is closed to new replies.