Skip to content

Instantly share code, notes, and snippets.

@donchenko
Created May 11, 2016 13:28
Show Gist options
  • Save donchenko/ba0519112b57cbb5da9aae61d1fd21c7 to your computer and use it in GitHub Desktop.
Save donchenko/ba0519112b57cbb5da9aae61d1fd21c7 to your computer and use it in GitHub Desktop.
Делаем вывод рубрик которые дочерние от 76й рубрики списком для виджета.
<?php
if( $terms = get_terms( 'category', array(
'orderby' => 'name',
'hide_empty' => 0,
'parent' => 76,
) ) ) :
echo '<ul class="sidebar_countries\">';
foreach ($terms as $term) :
echo '<li id="' . $term->slug. '"><a href="' . esc_url( get_term_link( $term ) ) . '">' . $term->name . '</a></li>';
endforeach;
echo '</ul>';
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment