Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Scordavis/9856605e68c287045ed932717b4d2fb0 to your computer and use it in GitHub Desktop.
Save Scordavis/9856605e68c287045ed932717b4d2fb0 to your computer and use it in GitHub Desktop.
Snippets WP
<?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