How to add a tag to wp_nav_menu in a child theme

The wp_nav_menu() function has a ton ( or bunch ) of parameters which makes customization fairly easy. I believe the one you’re specifically looking for is after which will add a passed string into the list after the link. An example would look like this: wp_nav_menu( array( ‘menu’ => ‘Main Menu’, ‘container’ => ‘nav’, ‘theme_location’=> … Read more

has_children in custom nav_walker

I have the same issue. Some answers claim that you can use $args->has_children or $args[0]->has_children, but it’s never added to $args. Sometimes, has_children is added under $args->walker->has_children, but it’s always set to false, in other words, useless… As a work around, the current template that I’m using adds a class to items that contain children … Read more

$args->has_children not working with start_el()

I just resolved this issue! Woo hoo! The thing is that using var_dump($args) shows a lot stuff like so: object(stdClass)#152 (16) { [“menu”]=> object(WP_Term)#145 (10) { [“term_id”]=> int(2) [“name”]=> string(9) “Main menu” [“slug”]=> string(9) “main-menu” [“term_group”]=> int(0) [“term_taxonomy_id”]=> int(2) [“taxonomy”]=> string(8) “nav_menu” [“description”]=> string(0) “” [“parent”]=> int(0) [“count”]=> int(12) [“filter”]=> string(3) “raw” } [“container”]=> string(0) … Read more

Add custom text to menu

There is another alt way to do this with CSS3. You would add a link to the WP Menu as normal but make the Location either javascript:void(0); or # so it doesn’t go anywhere (I would say the javascript… is the better way to prevent anchor link from firing). Then in your style.css or CSS … Read more

Walker gives additional taxonomy name?

Edit: After looking at the wp_list_categories() code I noticed that you can just pass a class parameter to the function. If you pass an empty string, the built-in Walker will always echo class=””. To get rid of the class attribute entirely, you will still have to use a custom walker and edit start_el: function start_el( … Read more

Show thumbnail for category?

There’s a great plugin called Taxonomy Images. It lets you set one image per category that you can then access in all sorts of ways. It’s a little funky in that it uses some custom filters to return the images, but the documentation is pretty good and you should be able to figure it out. … Read more

Add custom html to nav_menu

SOLVED>>>> I was able to add the button to the item_output variable. Basically I grabbed a walker class snippet and added the html to it. $item_output .= ‘<button class=”toggleExpand”><i class=”fa fa-arrow-circle-right”></i></button><a’. $attributes .’>’;

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)