0815

Du musst dich anmelden um Beiträge und Themen zu erstellen. Einloggen · Registrieren

WordPress Permalinks Outside of the Loop

Normally, permalink display via the_permalink() requires the loop. To display permalinks outside of the loop, we may use either of the following methods:

<!-- 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>

Source: Julien Chauvin (404 link removed 2013/06/27)




0