I'm trying to get custom fields to pull up a hashtag I put in inside a tweet button.
<a href="https://twitter.com/share" class="twitter-share-button" data-via="artofbackpackin" data-related="artofbackpackin" data-hashtags="<?php echo get_post_meta($post->ID, "tweethashtag", true); ?>">Tweet</a>
I've got the custom field filled in but for whatever reason, the hashtag is not displaying on the tweet button.
Has anyone tried doing this before?
Sorry. I should have added more details. The code above and the javascript is from the official Twitter share buttons. https://twitter.com/about/resources/buttons#tweet
The javascript is this: < script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");< /script>
If I were to put in normal text for data-related, it reads it okay and adds the hashtag to the tweet. Just not with the custom field.