Last active
May 28, 2019 21:55
-
-
Save ferdisahin/634a30e463c9689bb79198d7d50cd86b to your computer and use it in GitHub Desktop.
Wordpress İlk Kategoriyi Gösterme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ilk_kategori(){ | |
$kategoriler = get_the_category(); | |
if(!empty($kategoriler)){ | |
echo '<a href="'.esc_url(get_category_link($kategoriler[0]->term_id)).'">'.esc_html($kategoriler[0]->name).'</a>'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ilk_kategori(){ | |
$kategoriler = get_the_category(); | |
if(!empty($kategoriler)){ | |
echo esc_html($kategoriler[0]->name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment