Skip to content

Instantly share code, notes, and snippets.

@erickarbe
Created March 12, 2021 18:54
Show Gist options
  • Save erickarbe/53f6582e2a2f300a5d31ac239c802aec to your computer and use it in GitHub Desktop.
Save erickarbe/53f6582e2a2f300a5d31ac239c802aec to your computer and use it in GitHub Desktop.
<?php
// Click to tweet functionality. Look for the username and hashtags at the end of the string.
$main_question = get_the_title();
$twitter_quote = get_field('twitter_quote');
?>
<div class="tweet-this">
<a class="click-tweet" href="http://twitter.com/share?text=<?php echo html_entity_decode($main_question); ?> &#34;<?php if($twitter_quote) { echo urlencode($twitter_quote); } ?>&#34; via <?php echo $fullname . ' ' . $twitter_handle; ?>&url=<?php echo $roundup_permalink; ?>&hashtags=backswing @getbackswing" target="_blank">
Click to Tweet
</a>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment