How To Display WordPress Permalinks Outside of the Loop


Sponsored Links




The most easy method to display your permalink content in WordPress is using simply code. Because for some reason, we need to display Permalinks Outside our Standard WordPress Loop.

It’s can be done in WordPress with easily steps, just write down this code below in your theme files Outside your WordPress Look

<!-- external permalink via post ID -->
<a href="<?php echo get_permalink(33); ?>" >Permalink</a>

<!-- external permalink via global $post variable -->
<a href="<?php echo get_permalink($post->ID); ?>" >Permalink</a>


And done, it’s easily right? I hope tips how to display permalinks outside of the loop work without any worries work on you. Thanks for Julien Chauvin share this code

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

WordPress: Introducing the WordPress Loop, part 4 | Open Source

concerns customizing content display and covers a variety of tips related to manipulating the WordPress loop. including how to access permalinks outside the loop, how Read More

Function Reference/get permalink « WordPress Codex

It does NOT display the permalink and can be used outside of The Loop. Returns the permalinks of two specific See also: WordPress.com Read More

The Loop in Action « WordPress Codex

The navigation controls are included outside The Loop, but inside the if condition example.com/blog/2005/04 to select all posts from April, 2005), WordPress will display Read More

Using Author Template Tags Outside of the WordPress Loop

calling the information from the database outside of the WordPress Loop. I had the same issue. Display some author’s data OUTSIDE the loop. Regards Read More

#9963 (get_permalink() returns wrong link outside The Loop

Permalinks: Version: 2.8: Severity: returns the link of the last post in The Loop used to display get_permalink() returns wrong link outside The Loop Read More


5 Responses to How To Display WordPress Permalinks Outside of the Loop

  1. Thanks so much, superb advice, solved my coding issue nicely A1

  2. jboy says:

    This is awesome! Thank you so much for this… It saves my blog. :D Keep up the good work! Good day!

  3. Abraham says:

    Thanks for the codes.

    I have some that do the same thing with some variation. I thought these might be useful for other purposes.

    This one displays the Title of the Post as article
    =====================
    <a href="” title=”">
    ==============================

    This one displys the post url as the anchor text.
    ================================
    <a href="” >
    ===========================

  4. lajme shqip says:

    Thank you for this code. Helped me a lot .

  5. Christie says:

    Thank you so much for the codes. Nice blog, too. I’ve been checking out other pages and a lot have piqued my interest. Keep posting! :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>