WordPress.org

Support

Support » Plugins and Hacks » [Resolved] How to use YOURLS shortlink in theme php

[Resolved] How to use YOURLS shortlink in theme php

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Andrew Norcross
    Member

    @norcross

    the URL is stored in the postmeta table for each post. the key is _yourls_url. So you would want to get it using the get_post_meta call where appropriate

    prokopino
    Participant

    @prokopino

    can you please show me an exable of how i can use this option?
    lets say, i want to show in the visitors this:

    “the sortlink of this post for sharing is: “_yourls_url”

    how can i build the code to include it to my theme file? (i know how to include in theme, i dont know how to build the code snippet…

    thank you for your support!

    Plugin Author Andrew Norcross
    Member

    @norcross

    I’m adding a template tag in the next release and will include that in the readme file.

    Plugin Author Andrew Norcross
    Member

    @norcross

    @prokopino I’ve just added a template tag in the 1.06 release. To use in your theme, just add do_action('yourls_display'); anywhere within the post loop.

    prokopino
    Participant

    @prokopino

    thank you! very usefull for our sites!

    Plugin Author Andrew Norcross
    Member

    @norcross

    glad you find it useful!

    chuckingit
    Member

    @chuckingit

    Hey Andrew – great plugin and really impressed thus far … reason for chiming in is i think a conditional is perhaps best when adding to theme files – e.g.,
    `
    <?php if ( has_action( ‘yourls_display’ ) ) { do_action(‘yourls_display’); } ?>
    `

    the other thing, and perhaps this is off topic a bit, i’m really looking to get the YOURLS short url to integrate with my post’s social sharing icons … currently using another plugin that allows for Blitly integration and wonder if your plugin could to a wp_get_remote to pull the sharing links that YOURLS provides ..??.. since at the end of the day, i would like my short links to really be default shared when people click on sharing icon in WP post footers but i digress …

    thanks again for another Winning Norcross Plugin :>) cheers – chuck scott

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] How to use YOURLS shortlink in theme php’ is closed to new replies.