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 ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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