Wsparcie » Zaawansowane » Kateogire w menu

  • Witam, tworzę stronę na której chce w menu chce umieścić kategorie które będą automatycznie dodawane gdy jakaś kategoria zostanie dodana w wordpressie.Próbowałem tak ale nie działa prawidłowo.

    add_filter('wp_nav_menu_items','add_search_box_
    to_menu', 10, 2);
    function add_search_box_to_menu( $items, $args ) {
        if( $args->theme_location == 'header' )
            return $items .= "
    <li><a href='#'>Kategorie</a><ul class='sub-menu'>".wp_list_categories('sort_column=menu_order&title_li')."</li>
    ";
    
        return $items;
    }
    • Home
    • Kategorie
    • Kategoria1
    • Kategoria2
    • Kategoria3
    • Kontakt
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • Temat ‘Kateogire w menu’ jest zamknięty na nowe odpowiedzi.