wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
permalink_anchor › WordPress Function
Seit0.71
Veraltetn/v
› permalink_anchor ( $mode = 'id' )
Parameter: |
|
Definiert in: |
|
Codex: |
Displays the permalink anchor for the current post.
The permalink mode title will use the post title for the 'a' element 'id' attribute. The id mode uses 'post-' with the post ID for the 'id' attribute.Ähnliche Funktionen: permalink_link, permalink_single_rss, the_permalink_rss, get_permalink, the_permalink
Quellcode
function permalink_anchor( $mode = 'id' ) { $post = get_post(); switch ( strtolower( $mode ) ) { case 'title': $title = sanitize_title( $post->post_title ) . '-' . $post->ID; echo '<a id="' . $title . '"></a>'; break; case 'id': default: echo '<a id="post-' . $post->ID . '"></a>'; break; } }