Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

_alexsmith1 on "Need help coding a Twitter share button"

$
0
0

Hello all,

I need a bit of help creating a Twitter share button for my site. The one I'm using via the coding found on Twitter's dev page (https://dev.twitter.com/docs/tweet-button) is very close to what I need, but with one issue: it's using the page's title rather than the post's. The page title includes the name of my site as a prefix "The Original Society | [Post Title]". I want the text of the tweet to be in the format: [Post Title] [url] [via @origsociety1] instead of what I have now: [Page Title] [url] [via @origsociety1] using a share button with a vertical count box above. The code I'm using now is listed below, please help me adjust it as needed, thanks.

Also, here's a link to a post on my site: http://theoriginalsociety.com/eric-bellinger-i-dont-want-her-feat-problem-music-video/ please scroll towards the bottom of the post and click the tweet button to see its current behavior.

<div class='twitter-share share-widget'>
							<a href="https://twitter.com/share" class="twitter-share-button" data-via="origsociety1" data-lang="en" data-count="vertical">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
						</div>

Viewing all articles
Browse latest Browse all 8245

Trending Articles