get_template_part( 'taxonomy/content-taxonomy/content-taxonomy', $need_term->slug)
$need_term = wpp_get_term_top_level_id( $terms[0]->term_id, 'БББ' )- ошибка в else, если
$need_term = wpp_get_term_top_level_id( $terms[0]->term_id, 'БББ' );
get_template_part( 'taxonomy/content-taxonomy/content-taxonomy', $need_term->slug);
echo 'не установлены термины таксономии БББ'ошибка тут.
}
add_filter('template_include', function ($path){
if(is_single('Ввв')){
return get_stylesheet_directory() .'taxonomy/content-taxonomy/content-taxonomy-Ввв.php';
}
<?php
$terms = get_terms( array(
'taxonomy' => array( 'mylabel' ), // название таксономии с WP 4.5
'orderby' => 'id',
'order' => 'ASC',
'hide_empty' => true,
'object_ids' => null,
'include' => array(),
'exclude' => array(),
'exclude_tree' => array(),
'number' => '',
'fields' => 'all',
'count' => false,
'slug' => '',
'parent' => '',
'hierarchical' => true,
'child_of' => 0,
'get' => '', // all - выводит все термины
'name__like' => '',
'pad_counts' => false,
'offset' => '',
'search' => '',
'cache_domain' => 'core',
'name' => '', // str/arr поле name для получения термина по нему. C 4.2.
'childless' => false, // true не получит (пропустит) термины у которых есть дочерние термины. C 4.2.
'update_term_meta_cache' => true, // подгружать метаданные в кэш
'meta_query' => '',
) );
foreach( $terms as $term ){
echo '<div style="width: 90%; margin: 10px auto;border: 1px dotted red;">'
. '<h3><a href="">'.$term->name.'</a></h3>';
echo '<ol style="width: 90%; margin: 5px 30px;border: 1px dotted;">';
$query = new WP_Query( array(
'post_status' => 'publish',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'mylabel',
'field' => 'slug',
'terms' => $term->slug,
)
)
));
while ( $query->have_posts() ) { # внутренний цикл
$query->the_post();
?>
<li><?php echo '<a href="'. get_permalink( $post->ID ) .'">'. $post->post_title .'</a>';?> <span style="color: green; font-weight: bolder; padding-left: 20px;"><?php the_id ($post->ID) ?></li>
<?php
} # конец внутреннего
echo "</ol></div>";
};?>
</div>
// добавит поддержку меток к custom post type
'taxonomies' => array('post_tag')
'rewrite' => array( 'slug' => 'taksanomiya' )
add_action('init', 'create_aaaa_taxonomy');
function create_aaaa_taxonomy(){
// список параметров (когда давно подсмотрел тут): http://wp-kama.ru/function/get_taxonomy_labels
register_taxonomy('uslugi', array('aaaa'), array(
http://localhost:8089/uslugi/organizaczij/
классификации (категории, метки и т.д)созданного произвольного типа записи выдаёт 404.
выводите дочерние записи типа записей 'post'
и кстати, без доработок 'post' не имеет дочерних постов
Родитель
- дочка 1
- дочка 2
- и т.д.
if is_page(20)
....
wp_list_pages( $args );
....
<ul>
<li>Родитель</li>
<ul>
<li>- дочка 1</li>
<li>- дочка 2</li>
<li>- и т.д.</li>
</ul>
</ul>
if is_single(20)
....
wp_list_pages( $args );
....
Есть такой код:
11:23:52 [Tomcat] Problem detected! 11:23:52 [Tomcat] Port 8080 in use by ""E:\xampp7.4.1\apache\bin\httpd.exe" -k runservice"! 11:23:52 [Tomcat] Tomcat WILL NOT start without the configured ports free! 11:23:52 [Tomcat] You need to uninstall/disable/reconfigure the blocking application 11:23:52 [Tomcat] or reconfigure Tomcat and the Control Panel to listen on a different port
---------
Заголовок: Покрасить
Руками | Ногами | Головой
---------
<ul>
<li><a>Сломать</a></li>
<ul>
<li><a>Сломать руками</a></li>
<li><a>Сломать ногами</a></li>
</ul>
</ul>
<ul>
<li><a>Сломать</a></li>
Главная > Услуги гражданам > Сломать > Сломать руками
http://sait.ru/uslugi/grazhdanam/