WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. NewsCorpse
    Member
    Posted 3 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. Samuel Wood (Otto)
    Tech Ninja
    Posted 3 years ago #

    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
    Member
    Posted 3 years ago #

    Thanks.

    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. Samuel Wood (Otto)
    Tech Ninja
    Posted 3 years ago #

    You really should upgrade anyway.

    Still, try calling wpme_get_shortlink() instead.

  5. NewsCorpse
    Member
    Posted 3 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.

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic