Title: HTML-карта сайта для товаров WP e-Commerce
Last modified: 07.10.2015

---

# HTML-карта сайта для товаров WP e-Commerce

 *  [taktomedia](https://ru.wordpress.org/support/users/taktomedia/)
 * (@taktomedia)
 * [11 лет назад](https://ru.wordpress.org/support/topic/html-%d0%ba%d0%b0%d1%80%d1%82%d0%b0-%d1%81%d0%b0%d0%b9%d1%82%d0%b0-%d0%b4%d0%bb%d1%8f-%d1%82%d0%be%d0%b2%d0%b0%d1%80%d0%be%d0%b2-wp-e-commerce/)
 * Всем привет, для вывода всех товаров в HTML карте сайта, было найдено вот такое
   решение
 *     ```
       <ul>
       <?php
       $terms = get_terms( 'wpsc_product_category', 'orderby=name&');
   
       foreach ($terms as $term) {
   
         echo '<li><a href="' . get_term_link( $term ) . '"><h3>'.$term->name.'</h3></a>';
       echo '<ul>';
   
       $args = array(
       'post_type' => 'wpsc-product',
       'posts_per_page' => 400,
       'tax_query' => array( array( 'taxonomy' => 'wpsc_product_category', 'field' => 'slug', 'terms' => $term->slug ) ) );
       $new = new WP_Query($args);
       while ($new->have_posts()) {
       $new->the_post();
       echo '<li><a href="'.get_permalink().'">'.get_the_title().'</a></li>';
       }
       echo "</ul>";
       echo "</li>";
       } ?>
       </ul>
       ```
   
 * Нужно исключить категорию товаров с id 62. Пробовал разные подходы, не выходит.
   Буду очень благодарен за подсказку!
 * get_terms( ‘wpsc_product_category’, ‘orderby=name&’, ‘exclude=62’ — не реагирует
 * ‘exclude_wpsc_product_category’ => array(62), или просто 62 или ’62’
    ‘exclude_product_category’
   => array(62), или просто 62 или ’62’ ‘exclude’ => array(62), или просто 62 или’
   62’ так же не реагирует

Просмотр 3 ответов — с 1 по 3 (всего 3)

 *  [Flector](https://ru.wordpress.org/support/users/flector/)
 * (@flector)
 * [11 лет назад](https://ru.wordpress.org/support/topic/html-%d0%ba%d0%b0%d1%80%d1%82%d0%b0-%d1%81%d0%b0%d0%b9%d1%82%d0%b0-%d0%b4%d0%bb%d1%8f-%d1%82%d0%be%d0%b2%d0%b0%d1%80%d0%be%d0%b2-wp-e-commerce/#post-187726)
 *     ```
       /* Exclude Category from Shop*/
   
       add_filter( 'get_terms', 'get_subcategory_terms', 10, 3 );
   
       function get_subcategory_terms( $terms, $taxonomies, $args ) {
   
         $new_terms = array();
   
         // if a product category and on the shop page
         if ( in_array( 'product_cat', $taxonomies ) && ! is_admin() && is_shop() ) {
   
           foreach ( $terms as $key => $term ) {
   
             if ( ! in_array( $term->slug, array( 'project1', 'susan' ) ) ) {
               $new_terms[] = $term;
             }
   
           }
   
           $terms = $new_terms;
         }
   
         return $terms;
       }
       ```
   
 * это не совсем то, но смысл должен быть понятен.
 *  Автор [taktomedia](https://ru.wordpress.org/support/users/taktomedia/)
 * (@taktomedia)
 * [11 лет назад](https://ru.wordpress.org/support/topic/html-%d0%ba%d0%b0%d1%80%d1%82%d0%b0-%d1%81%d0%b0%d0%b9%d1%82%d0%b0-%d0%b4%d0%bb%d1%8f-%d1%82%d0%be%d0%b2%d0%b0%d1%80%d0%be%d0%b2-wp-e-commerce/#post-187728)
 * Смысл понятен, но не увидел атрибута который указывает на исключение категории
   по id. Насколько я понимаю, должен быть некий exclude
 *  [Flector](https://ru.wordpress.org/support/users/flector/)
 * (@flector)
 * [11 лет назад](https://ru.wordpress.org/support/topic/html-%d0%ba%d0%b0%d1%80%d1%82%d0%b0-%d1%81%d0%b0%d0%b9%d1%82%d0%b0-%d0%b4%d0%bb%d1%8f-%d1%82%d0%be%d0%b2%d0%b0%d1%80%d0%be%d0%b2-wp-e-commerce/#post-187790)
 *     ```
       if ( ! in_array( $term->slug, array( 'project1', 'susan' ) ) ) {
               $new_terms[] = $term;
             }
       ```
   
 * вот тут проверка на то, какие рубрики не должны попадать в общий список.

Просмотр 3 ответов — с 1 по 3 (всего 3)

 Тема «HTML-карта сайта для товаров WP e-Commerce» закрыта для новых ответов.

## Метки

 * [html sitemap](https://ru.wordpress.org/support/topic-tag/html-sitemap/)
 * [wp-ecommerce](https://ru.wordpress.org/support/topic-tag/wp-ecommerce/)

 * Форум: [Проблемы и решения](https://ru.wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 ответа
 * 2 участника
 * Последний ответ: [Flector](https://ru.wordpress.org/support/users/flector/)
 * Последняя активность: [11 лет назад](https://ru.wordpress.org/support/topic/html-%d0%ba%d0%b0%d1%80%d1%82%d0%b0-%d1%81%d0%b0%d0%b9%d1%82%d0%b0-%d0%b4%d0%bb%d1%8f-%d1%82%d0%be%d0%b2%d0%b0%d1%80%d0%be%d0%b2-wp-e-commerce/#post-187790)
 * Статус: нерешённая

## Темы

### Самые популярные темы

### Темы без ответов

### Без вопроса

### Решённые

### Нерешённые

### Все темы
