Forked from agragregra/WordPress Get Category name By label
Last active
May 4, 2017 18:11
-
-
Save Scordavis/9856605e68c287045ed932717b4d2fb0 to your computer and use it in GitHub Desktop.
Snippets WP
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
<?php | |
$idObj = get_category_by_slug('s_about'); | |
$id = $idObj->term_id; | |
echo get_cat_name($id); | |
?> | |
или | |
<?php | |
$idObj = get_category_by_slug('sto_section'); | |
$id = $idObj->term_id; | |
echo category_description($id); | |
?> | |
<?php if ( have_posts() ) : query_posts('category_name=sto_section'); | |
while (have_posts()) : the_post(); ?> | |
<? endwhile; endif; wp_reset_query(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment