Replacing Permalink With wp.me Shortlink? (5 posts)

  1. NewsCorpse
    Posted 6 years ago #

    I am using the AddThis plugin to share blog posts. I currently have code that says:

    <?php do_action('addthis_widget', get_permalink(), the_title('', '', false)); ?>

    I would like this to use the wp.me shortlink instead of the permalink because one of the apps I'm sharing to is Twitter.

    Is this possible?

  2. Yes.

    First, you need to upgrade to WP 3.0.

    Second, you need to install and configure the Stats plugin: http://wordpress.org/extend/plugins/stats/ . This is necessary because wp.me links are implemented through WordPress.com, and the stats plugin is what links your site to the backend systems of WordPress.com.

    Third, you'll use the wp_get_shortlink() function instead of get_permalink().

    That's all there is to it, basically.

  3. NewsCorpse
    Posted 6 years ago #


    I was hoping to implement it in 2.9.2 because I usually like to wait awhile before upgrading to new versions. I already have wp-stats so I thought there would be a way to grab the shortlink.

    I guess I'll just have to upgrade first, unless someone else has another solution.

  4. You really should upgrade anyway.

    Still, try calling wpme_get_shortlink() instead.

  5. NewsCorpse
    Posted 6 years ago #

    You are AWESOME, Otto. That worked perfectly. And when I upgrade to 3.0 (or 3.01) all I have to do is take the "me" out of the code.


Topic Closed

This topic has been closed to new replies.

About this Topic