Mitchell McKenna - tagged with publicize http://mitchmckenna.com/feed en-us http://blogs.law.harvard.edu/tech/rss LifePress mitchellmckenna@gmail.com Fix WordPress' Jetpack Publicize Not Using Correct URL Structure in Permalink http://mitchmckenna.com/post/15187/fix-wordpress-jetpack-publicize-not-using-correct-url-structure-in-permalink

Jetpack's Publicize can be a handy feature to automatically share your post to various social network's like facebook, twitter and google plus.

One of the annoying features is when it shares it on those social networks it posts a http://wp.me... short link. You can fix that by deactivating "WP.me Shortlinks" in Jetpack settings.

Another annoying thing is even if "WP.me Shortlinks" is disabled, it will share the url in the classic http://domain.com/?p=123 permalink structure. In order to fix this, add the following to your theme's functions.php file:

function tweakjp_cust_shortlink() {
    global $post;

    if (!$post) {
        return;
    }

    return get_permalink($post->ID);
}
add_filter( 'get_shortlink', 'tweakjp_cust_shortlink' );


This solution was posted by the Publicize plugin author here: https://wordpress.org/support/topic/publicize-full-url-to-twitter

]]>
Tue, 17 Feb 2015 03:35:50 -0500 http://mitchmckenna.com/post/15187/fix-wordpress-jetpack-publicize-not-using-correct-url-structure-in-permalink/fix-wordpress-jetpack-publicize-not-using-correct-url-structure-in-permalink