Articles of menus

Adding content inside the anchor tags within WordPress main nav

I’m using FontAwesome and hence I need to include some extra code next to parent menu options that have a sub-menu, such as: <li> <a href=””>About <span class=”fa fa-angle-down”></span></a> <ul class=”sub-menu”> <li><a href=””>About Us</a></li> <li><a href=””>Why Choose Us?</a></li> </ul> </li> However I am unsure how to do this when using wp_nav_menu. My code: wp_nav_menu( array( […]

Menu deletes all items and position – wordpress bug?

I just went through one of our sites and updated every plugin and WordPress to 4.2.2. After upgrading I was supposed to do some menu changes, but after “successfully” saving the menu every item was cleared from the menu and it’s position was reset to nothing.. I then started building the menu all over again, […]

Current author archive in navigation menu

I want logged-in user see her/his own author archive page link in top navigation menu,say (a link to a list of all her/his posts). What I achieved so far is this: function my_nav_menu_author_link( $menu ) { if( !is_user_logged_in() ){ return $menu; }else{ $link = get_author_posts_url( get_current_user_id() ); $author_archive_link = ‘<li>’ . ‘<a href=”‘ . $link […]

WordPress functions.php does not affect the theme menus

I am trying to customize my pre bought theme. What i try is, to have different menus for each page without using a plugin. Original theme has a function about navigation which uses walker class. here is the file in the original.entrepreneur theme. I use Entrepreneur Child Theme. I want to use primary navigation […]

Extend Menu Walker Output

I’ve found a custom Menu Walker on the Internet that was perfect for my multilevel menu. It fitted almost like a glove. I’ve made some tiny improvements but now I need to limit the number of characters inside the output: <li><a href=”http:\\…”><span>Blah Blah Blah Blah Blah Blah Blah Blah Blah</span></a></li> I’m having some problems to […]

URL links consistent with menus?

I’d like to have a URL links consistent with menus on the page. For example: Menu1: Submenu1 item1 item2 Submenu2 item3 item4 Menu2: Submenu… etc.. The corresponding links shoud be: etc. However, the links are etc. How can I fix this?

Mark menu item as current-menu-item for category

I have some categories on my WP website. When users sees this categories and posts from them i want to mark one of menu items as active. How can i set one of my menu items to have class “current-menu-item” for this categories and posts?

Adding archive years to my menu

I’m WordPress newbie and despite of reading many articles, I’m able to put archive years to my main menu. Menu contains pages and I need to add an archive. My current menu: – Home (page) – About (page) – News (Category) – Contact (page) And I need – Home (page) – About (page) – News […]

How can i display custom menu in sidebar?

I would like to display a custom menu in a custom sidebar instead of author information or blank space i.e custom menu with similar styles as default menu but only in vertical manner as displayed in grey in the below picture.

is_page() not working with archives?

I am creating a dynamic menu and in my foreach loop I am running a is_page using the page title: <li class=”<?= (is_page($tlp->post_title) ? ‘active’ : ”);?>”> </li> This works fine for pages that are actually created in the WP admin. But for other post types that rely on the archive it doesn’t work. So […]