M
M
Muvka2018-05-02 19:07:46
WooCommerce
Muvka, 2018-05-02 19:07:46

How to display WooCommerce category description when sorting is changed?

Instead of a category description, I get a description of one of the products when I change the sorting method. get_queried_object() outputs complete nonsense.

WP_Post_Type Object ( [name] => product [label] => Товары [labels] => stdClass Object ( [name] => Товары [singular_name] => Товар [add_new] => Добавить товар [add_new_item] => Добавить новый товар [edit_item] => Изменить товар [new_item] => Новый товар [view_item] => Просмотреть товар [view_items] => Просмотр записей [search_items] => Поиск по товарам [not_found] => Товаров не обнаружено [not_found_in_trash] => В урне товаров не обнаружено [parent_item_colon] => [all_items] => Товары [archives] => Товары [attributes] => Свойства записи [insert_into_item] => Вставьте в товар [uploaded_to_this_item] => Загружено в товар [featured_image] => Изображение товара [set_featured_image] => Задать изображение товара [remove_featured_image] => Удалить изображение товара [use_featured_image] => Использовать в качестве изображения товара [filter_items_list] => Фильтровать товары [items_list_navigation] => Навигация по товарам [items_list] => Список товаров [menu_name] => Товары [edit] => Изменить [view] => Просмотреть товар [parent] => Родительский товар [name_admin_bar] => Товар ) [description] => Здесь вы можете добавлять новые товары в ваш магазин. [public] => 1 [hierarchical] => [exclude_from_search] => [publicly_queryable] => 1 [show_ui] => 1 [show_in_menu] => 1 [show_in_nav_menus] => 1 [show_in_admin_bar] => 1 [menu_position] => [menu_icon] => [capability_type] => product [map_meta_cap] => 1 [register_meta_box_cb] => [taxonomies] => Array ( ) [has_archive] => dostavka-cvetov-v-kirove-bukety-podarki [query_var] => product [can_export] => 1 [delete_with_user] => [_builtin] => [_edit_link] => post.php?post=%d [cap] => stdClass Object ( [edit_post] => edit_product [read_post] => read_product [delete_post] => delete_product [edit_posts] => edit_products [edit_others_posts] => edit_others_products [publish_posts] => publish_products [read_private_posts] => read_private_products [read] => read [delete_posts] => delete_products [delete_private_posts] => delete_private_products [delete_published_posts] => delete_published_products [delete_others_posts] => delete_others_products [edit_private_posts] => edit_private_products [edit_published_posts] => edit_published_products [create_posts] => edit_products ) [rewrite] => Array ( [slug] => product [with_front] => [feeds] => 1 [pages] => 1 [ep_mask] => 1 ) [show_in_rest] => 1 [rest_base] => [rest_controller_class] => )

I can't even get the page or category ID. What's wrong, tell me.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question