Помощник
|
Wordpress вывод подкатегорий у активной категории |
konstantinskiy
|
Сообщение
#1
|
||
|
|
||
|
|||
RageLT |
16.7.2013, 16:23;
Ответить: RageLT
Сообщение
#2
|
|
|
<?php $category = get_the_category(); if (is_category()) { $this_category = get_category($cat); if($this_category->category_parent) { $this_category = wp_list_categories('orderby=name&show_count=0¤t_category='.$category[0]->cat_ID.'&title_li=&use_desc_for_title=0&child_of='.$this_category->category_parent."&echo=0"); } else { $this_category = wp_list_categories('orderby=name&depth=1&show_count=0¤t_category='.$category[0]->cat_ID.'&title_li=&use_desc_for_title=0&child_of='.$this_category->cat_ID."&echo=0"); } } elseif ( is_single()) { if($category[0]->category_parent) { $this_category = wp_list_categories('orderby=name&show_count=0¤t_category='.$category[0]->cat_ID.'&title_li=&use_desc_for_title=0&child_of='.$category[0]->category_parent."&echo=0"); } else { $this_category = wp_list_categories('orderby=name&show_count=0¤t_category='.$category[0]->cat_ID.'&title_li=&use_desc_for_title=0&child_of='.$category[0]->cat_ID."&echo=0"); } } ?> Вывод: <?php echo $this_category; ?>
-------------------- |
|
|
||
|
Похожие темы
Тема | Ответов | Автор | Просмотров | Последний ответ | |
---|---|---|---|---|---|
Нужен кодер, чтобы пофиксить ошибку Wordpress после переноса сайта | 0 | Alex-777 | 847 | 7.4.2024, 18:05 автор: Alex-777 |
|
Продам базу сайтов Wordpress в 16 миллионов доменов! Свежая сборка. | 17 | Boymaster | 10918 | 17.3.2024, 2:53 автор: Boymaster |
|
Перенос сайта на CMS Wordpress | 8 | freeax | 4956 | 10.3.2024, 14:58 автор: freeax |
|
Как настроить в WordPress для SEO оптимизации | 8 | rownong27 | 2474 | 2.3.2024, 12:59 автор: toplinks |
|
Восстановление сайтов из Вебархива на Wordpress. | 39 | freeax | 32736 | 14.2.2024, 14:32 автор: freeax |
Текстовая версия | Сейчас: 19.4.2024, 11:15 |