Switch language

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




the_category_head [ WordPress Function ]

the_category_head ( $before = '', $after = '' )
Parameters:
  • (string) $before
  • (string) $after
See:
  • get_the_category_by_ID()
Defined at:



Print category with optional text before and after.

Source


<?php
function the_category_head($before=''$after='') {
    global 
$currentcat$previouscat;

    
_deprecated_function__FUNCTION__'0.71''get_the_category_by_ID()' );

    
// Grab the first cat in the list.
    
$categories get_the_category();
    
$currentcat $categories[0]->category_id;
    if ( 
$currentcat != $previouscat ) {
        echo 
$before;
        echo 
get_the_category_by_ID($currentcat);
        echo 
$after;
        
$previouscat $currentcat;
    }
}
?>

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