Как к пункту меню стандартного WordPress добавить свой шорткод?

хочу вывести через шорткод кол-во еще у пункта меню

Добавьте следующий код в functions.php


add_filter('nav_menu_item_title', 'do_shortcode_in_menu_items', 10, 4);

function do_shortcode_in_menu_items($title, $item, $args, $depth) {
    return do_shortcode($title);
}

после прямо в “Ярлык навигации” добавьте шорткод

На сайте пример:

guest
Другие сообщения форума
Закрыть меню
ZAPLATA.RU | Магазин готовых блогов Wordpress с автонаполнением
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.