Adding post excerpt into navigation menu

wp_nav_menu() calls walk_nav_menu_tree() which calls the Walker_Nav_Menu class. There are a couple of filters you can hook into in those functions but I would take a look at the nav_menu_item_title filter in the Walker_Nav_Menu class. Here is the source: /** * Filter a menu item’s title. * * @since 4.4.0 * * @param string $title … Read more

Style wp_page_menu() items

Please find below the function for showing navigation menu. Here, $menu is equivalent to Menu name, ID, or slug <?php function showMyMenu($menu) { $navData = wp_get_nav_menu_items($menu); ?> <ul class=”nav navbar-nav navbar-right is-hidden”> <?php foreach($navData as $k => $v) { echo ‘<li><a class=”page-link” href=”‘ . $v->url . ‘”> ‘ . $v->title . ‘ </a></li>’; } ?> … Read more

.sub-menu or .children?

What One Trick Pony said; look in Appearance > Menus on both sites and check if the menu has been populated. If so, check to see if the Theme Location has been set and saved. If they are different that may be what’s causing different menu structures to be rendered. Let us know how it … Read more

Menus like a CMS

3 ideas: Create the empty parent pages and use a redirect plugin to redirect all requests from these pages to the children. Inside the menu options page insert a custom link and link to the desired child page. At the top of your template – lets say page.php – test if children for this page … Read more

Multiple menu items highlighted

This question was also asked on stackoverflow. Here’s a copy of the answer i gave there: Perhaps you could style it using the nth-of-type CSS3 selector. .current-menu-item:nth-of-type(1) { background:#ffff00; /* Highlight styles */ } These styles would target only the first occurrence of the .current-menu-item. Likewise, you could choose to target the second with nth-of-type(2), … Read more

items_wrap not working

your problem is in your use ‘menu_class’ and ‘items_wrap’ not synchronized. You can edit : wp_nav_menu( array( ‘theme_location’ => ‘header-menu’, ‘container’ => ”, ‘echo’ => ‘0’, ‘menu_class’ => ‘nav-menu horiz-menu container sixteen columns’, ‘items_wrap’ => ‘<ul class=”%2$s”>%3$s</ul>’ ) ) or: wp_nav_menu( array( ‘theme_location’ => ‘header-menu’, ‘container’ => ”, ‘echo’ => ‘0’, ‘items_wrap’ => ‘<ul class=”nav-menu … 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

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