{"id":6919,"date":"2010-11-30T09:04:41","date_gmt":"2010-11-30T15:04:41","guid":{"rendered":"http:\/\/www.casadeblundell.com\/jonathan\/?p=6919"},"modified":"2010-11-30T09:08:10","modified_gmt":"2010-11-30T15:08:10","slug":"how-to-share-on-twitter-with-wp-me-short-url","status":"publish","type":"post","link":"http:\/\/casadeblundell.com\/jonathan\/how-to-share-on-twitter-with-wp-me-short-url\/","title":{"rendered":"How to Share on Twitter with a wp.me short URL"},"content":{"rendered":"<figure id=\"attachment_6926\" aria-describedby=\"caption-attachment-6926\" style=\"width: 345px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/kailoon.com\/free-vector-icons-set-twitter-birdy-icon\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.casadeblundell.com\/jonathan\/wp-content\/uploads\/345.png\" alt=\"Twitter bird\" title=\"Twitter bird\" width=\"345\" height=\"345\" class=\"size-full wp-image-6926\" srcset=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/345.png 345w, http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/345-150x150.png 150w, http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/345-300x300.png 300w\" sizes=\"auto, (max-width: 345px) 100vw, 345px\" \/><\/a><figcaption id=\"caption-attachment-6926\" class=\"wp-caption-text\">Twitter bird via http:\/\/kailoon.com\/free-vector-icons-set-twitter-birdy-icon\/<\/figcaption><\/figure>\n<p><a href=\"http:\/\/www.casadeblundell.com\/jonathan\/social-media-hacks-for-your-website\/\">A while back<\/a> I shared a simple tip on how to add a Share on Twitter link to your WordPress blog&#8230;<\/p>\n<p><code>&lt;a rel=&quot;nofollow&quot; href=&quot;http:\/\/twitter.com\/home?status=&lt;?php echo urlencode(&quot;Currently reading: &quot;); ?&gt;&lt;?php the_permalink(); ?&gt;&quot; title=&quot;Share this article with your Twitter followers&quot;&gt;Tweet this!&lt;\/a&gt;<\/code><\/p>\n<p>But if your URL&#8217;s are too long and you&#8217;d like a more concise Tweet &#8212; there are a few other options for doing this as well (without using plugins).<br \/>\n<!--more--><br \/>\nTo keep your domain in the URL, you can easily use WordPress&#8217; built in &#8220;ugly permalink&#8221; feature to reduce the size of your URL. The ugly permalink is automatically assigned to each post as it&#8217;s ID in the database and is also automatically linked to whatever pretty permalink structure you&#8217;re using.<\/p>\n<p><a href=\"http:\/\/www.casadeblundell.com\/jonathan\/west-wing-dvd\/\">http:\/\/www.casadeblundell.com\/jonathan\/p?=666<\/a> automatically directs the reader to<br \/>\n<a href=\"http:\/\/www.casadeblundell.com\/jonathan\/west-wing-dvd\/\">http:\/\/www.casadeblundell.com\/jonathan\/west-wing-dvd\/<\/a><\/p>\n<p>So to build a link, the key is getting the post ID number (the number after ?p=) for each post using <strong>the_ID<\/strong>.<\/p>\n<p>Your code will look something like this&#8230;<\/p>\n<p><code>&lt;a rel=&quot;nofollow&quot; href=&quot;http:\/\/twitter.com\/home?status=&lt;?php echo urlencode(&quot;Currently reading: &quot;); ?&gt;&lt;?php the_title(); ?&gt; http:\/\/www.casadeblundell.com\/jonathan\/?p=&lt;?php the_ID(); ?&gt;&quot;&gt; title=&quot;Share this article with your Twitter followers&quot;&gt;Tweet this!&lt;\/a&gt;<\/code><\/p>\n<p>(Be sure you replace my domain with yours.)<\/p>\n<p>Or another option for shorter URL&#8217;s is to use the wp.me short URL from WordPress.com.<\/p>\n<p>To do so, you&#8217;ll need to install the <a href=\"http:\/\/wordpress.org\/extend\/plugins\/stats\/\">WordPress.com stats plugin<\/a> on your site (which is a nice plugin to have regardless).<\/p>\n<p>Once the plugin is installed, be sure and activate the wp.me option in the WordPress.com Stats settings. (<em>Plugins<\/em> > <em>WordPress.com Stats<\/em> and then select the box next to &#8220;Publish WP.me shortlinks as metadata&#8221;)<\/p>\n<p>Now that that&#8217;s completed you can add the code to your pages.<\/p>\n<p><code>&lt;a rel=&quot;nofollow&quot; href=&quot;http:\/\/twitter.com\/home?status=&lt;?php echo urlencode(&quot;Currently reading: &quot;); ?&gt;&lt;?php the_title(); ?&gt; &lt;?php echo wp_get_shortlink(); ?&gt;&quot;&gt; title=&quot;Share this article with your Twitter followers&quot;&gt;Tweet this!&lt;\/a&gt;<\/code><\/p>\n<p>There you have it. <\/p>\n<p>Personally I&#8217;m using the wp.me option right now for most of my sites. <strong>But which option do you prefer?<\/strong><\/p>\n<p>And of course, if you found this helpful, please share via the social media buttons below. Thanks!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A while back I shared a simple tip on how to add a Share on Twitter link to your WordPress blog&#8230; &lt;a rel=&quot;nofollow&quot; href=&quot;http:\/\/twitter.com\/home?status=&lt;?php echo urlencode(&quot;Currently reading: &quot;); ?&gt;&lt;?php the_permalink(); ?&gt;&quot; title=&quot;Share this article with your Twitter followers&quot;&gt;Tweet this!&lt;\/a&gt; But if your URL&#8217;s are too long and you&#8217;d like a more concise Tweet &#8212; there &hellip; <a href=\"http:\/\/casadeblundell.com\/jonathan\/how-to-share-on-twitter-with-wp-me-short-url\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How to Share on Twitter with a wp.me short URL<\/span><\/a><\/p>\n","protected":false},"author":84,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[3708],"tags":[943,2733,3924,2018,221,1184,3925],"class_list":["post-6919","post","type-post","status-publish","format-standard","hentry","category-wordpress-techno","tag-hack","tag-how-to","tag-short-url","tag-social-media","tag-twitter","tag-wordpress","tag-wp-me"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pEnSo-1NB","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/posts\/6919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/users\/84"}],"replies":[{"embeddable":true,"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/comments?post=6919"}],"version-history":[{"count":0,"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/posts\/6919\/revisions"}],"wp:attachment":[{"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/media?parent=6919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/categories?post=6919"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/tags?post=6919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}