Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




rel_canonical [ WordPress Function ]

rel_canonical ( No parameters )
Defined at:



Output rel=canonical for singular queries.

Source


<?php
function rel_canonical() {
    if ( !
is_singular() )
        return;

    global 
$wp_the_query;
    if ( !
$id $wp_the_query->get_queried_object_id() )
        return;

    
$link get_permalink$id );
    echo 
"<link rel='canonical' href='$link' />\n";
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics