Incorrect Permalink on Homepage
-
Hello all & thank you ahead of time for any insight to the following:
I have been integrating custom ShareThis buttons (I’m not using the WP plugin) into a site and they work fine on all pages except on the homepage. The homepage displays only the newest post and paginates to display older posts (e.g. ‘site.com’, ‘site.com/page/1/’, ‘site.com/page/2/’). All posts show up as they should, but, a few pages in the link that the ShareThis service links to is incorrect. Often, the post is not in the ‘homepage’ category at all.
The link can be sent to ShareThis by using a meta tag:
<meta property="og:url" content="<?php the_permalink();?>" />
or by including it in an encoded page link:
<li class="facebook"><span class="st_facebook_custom" displayText="Share"><a href="<?php urlencode('https://rest.sharethis.com/share/sharer.php?destination=facebook&url=URL_TO_BE_SENT&title='.get_the_title().'&publisher=PUBLISHER_KEY&access_key=ACCESS_KEY');?>"><p>share</p></a></span></li>
The permalink displays correctly on the page, so somehow the link is changed when being sent to the ShareThis service. (right?)
I’ve tried several different (and roundabout) ways while trying to fix this but have been continually unsuccessful. I’m no expert in this, so it is likely I’m just doing something stupid, but if anyone has experience with this and can help me out I would be extremely grateful.
Thanks again for any ideas about this…
- The topic ‘Incorrect Permalink on Homepage’ is closed to new replies.