Tagged: social sharing buttons
-
AuthorPosts
-
September 11, 2015 at 1:17 am #501363
Hi,
I’ve have a template page on my website that dynamically pulls concert information through from some custom database tables. Generally it works perfectly, but I just can’t get the social sharing buttons to work properly on it.
An example of the page is here: http://www.rsno.org.uk/live/concert-listing/concert-information/?c_id=341&action=Read+More
I copied the source code for the social sharing buttons from a normal, static WordPress page that I created within the Avia Layout Builder on Enfold. I managed to get the icons sorted out using the HTML Entity (decimal) of the character codes, but it’s the actual URLs being shared that aren’t working.
I’m using the following code to create the URL I am sharing, as the permalink() function doesn’t work with dynamic pages:
<?php $sharing_url = "http://www.rsno.org.uk" . $_SERVER['REQUEST_URI']; $social_url = htmlspecialchars($sharing_url, ENT_QUOTES, 'UTF-8'); ?>
Even though it seems to be appearing properly in the source code (in that it looks similar to the source code of the static wordpress version) the actual URL that is shared on the various social media sites cuts off at http://www.rsno.org.uk/live/concert-listing/concert-information/?c_id=341 and misses the &action=Read+More which is kind of vital for viewing the page.
I’ve tried just putting the URL in without the htmlspecialchars(), but the & doesn’t work any better than the & in the URLs (besides the URLs in the static version have the & in them). I’ve put the two side by side below for comparison. The URLs are different as they are obviously different pages, but everything else is the same.
Source code from “static” version
<li class=’av-share-link av-social-link-facebook’ ><span class=’avia_hidden_link_text’>Share on Facebook</span>Source code from “dynamic” version
<li class=’av-share-link av-social-link-facebook’ ><span class=’avia_hidden_link_text’>Share on Facebook</span>Can anyone suggest what I may be missing/doing wrong?
Thanks,
CatSeptember 12, 2015 at 10:45 am #502055Hi!
Please note that this is not exactly a theme issue but the FB link seems to be pulling the full URL:
http://www.facebook.com/sharer.php?u=http://www.rsno.org.uk/live/concert-listing/concert-information/?c_id=341&action=Read+More&t=Oundjian%20and%20Benedetti
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.