_alexsmith1
Forum Replies Created
-
Forum: Hacks
In reply to: Need help coding a Twitter share buttonI found the answer myself on a Twitter dev support thread. Here’s the code that makes the Twitter button grab the WordPress title:
<a href="https://twitter.com/share" class="twitter-share-button" data-via="YOUR_TWITTER_ID_HERE" data-text="<?php the_title(); ?>" data-url="<?php the_permalink(); ?>" data-lang="en">Tweet</a> <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="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>I just need to make this a vertical button with count box and I’ll be set.
Forum: Hacks
In reply to: Need help coding a Twitter share buttonActually, I still need help. I’d like my SEO title to contain my site’s name, which is what I’ve set it to do, so now the original issue has come up again. I need the code for the tweet button to be modded to grab the WordPress post title rather than the SEO title. The above suggestion did not do anything, the tweet button still grabs the SEO title instead of the post title.
Forum: Hacks
In reply to: Need help coding a Twitter share buttonThanks for your help. I had already marked this as resolved because after I setup SEO titles this issue ended up working itself out. Hopefully your response helps someone else, though.
This method does not help with the issue. Setting the option not to appear via screen options just minimizes it, it still by default shows the featured image in posts, which is what I’m trying to get away from.