Questions tagged [wp-nav-menu-item]

59 questions
70
votes
15 answers

How to add Class in
  • using wp_nav_menu() in Wordpress?
  • I am using wp_nav_menu($args) and I want to add my_own_class CSS classname to the
  • element. I'd like to get the following result:
  • Link How to do that?
  • Ayyaz Zafar
    • 2,015
    • 5
    • 26
    • 40
    27
    votes
    6 answers

    wp_nav_menu - add class on UL

    I am learning wordpress together with bootstrap and somehow I can't add class on UL tag. In the screenshot, I want to add class nav nav-tabs on UL but it was added on parent div $defaults = array( 'menu_class'=> 'nav nav-tabs', …
    JunM
    • 7,040
    • 7
    • 37
    • 58
    7
    votes
    5 answers

    How to add class and element to -tag in sub-menu of "wp_nav_menu" in WordPress?

    i want to add a class to the a tag of an sub-menu and a b tag inside the link. WordPress gives me this code:
  • Link
    Cray
    • 5,307
    • 11
    • 70
    • 166
  • 3
    votes
    3 answers

    WordPress menu is placed outside the header

    If the user goes to a page other than the homepage then my header changes layout. Everything works fine except for the function wp_nav_menu. First, I check whether the user is on the homepage or not. Depending on that outcome the user is shown one…
    Interactive
    • 1,474
    • 5
    • 25
    • 57
    2
    votes
    1 answer

    how to add dot in the active nav menu

    hello this is my nav menu code i've added animation like a dot move along when i hover over my nav menu. but i don't know how to make that dot to be static in the active menu . ex: (menu1) this is my menu , when it'active i want that dot beside my…
    david19999
    • 21
    • 2
    2
    votes
    0 answers

    Get template part in wp nav menu

    I'm trying to add my own field to the menu using get_template_part. The problem is that my code is not working well because it is outside
    2
    votes
    1 answer

    Current level navigation in Wordpress

    I have a 3 level navigation: Home > submenu1 >> sub3 > submenu >> sub4 >> sub5 // current page About > about2 >> sub6 > about3 >> sub7 I am trying to get each…
    Luc Laverdure
    • 1,398
    • 2
    • 19
    • 36
    2
    votes
    0 answers

    Wordpress Nav Error Undefined property: WP_Post_Type::$term_id

    I've run into a problem that it looks like a few people have faced but no one has posted a solution for. The problem occurs after creating a Custom Post Type & Custom Taxonomy when I use the wp_nav_menu() function. I only see this error on my…
    AdheneManx
    • 306
    • 3
    • 11
    2
    votes
    0 answers

    Converting html menu to wordpress menu

    I am trying to convert html to wordpress. The conversion is complete but I want to change the static html menu to a wordpress wp_nav_menu. This is my static html code:
    1
    vote
    0 answers

    Is there a css only way to blur the background of the page when you hover a nav link that has a dropdown menu?

    I am trying to a way to blur the entire page when I hover over a nav link that has children.
    1
    vote
    0 answers

    Using JS variables with WordPress menu fails

    I'm using wp_nav_menu to load a WordPress menu as follows: 'menu-1', // 'menu_id' => 'primary-menu', …
    stemlund
    • 41
    • 1
    1
    vote
    1 answer

    Add extra div to WordPress nav items

    Whats the most simple way to change my wp-menu generated output from to
    JonSnow
    • 573
    • 14
    • 48
    1
    vote
    1 answer

    Turning a wp_nav_menu into a foreach loop

    I have a customised wp_nav_menu navigation that is outputting a whole list of sub page items from just one echo line... 'primary', 'menu_id' => 'main-menu', 'before' …
    Shaun Taylor
    • 932
    • 2
    • 16
    • 43
    1
    vote
    1 answer

    wp_nav_menu_items - First position in the nav menu

    I am using the following code to add a search box into the navigation menu: add_filter( 'wp_nav_menu_items','add_search_box', 10, 2 ); function add_search_box( $items, $args ) { $items .= '
    Joe Bloggs
    • 1,410
    • 2
    • 24
    • 53
    1
    vote
    0 answers

    WordPress Nav Menu Items Broken on localhost

    I'm having major issues with my local development version of a client's site. I've been working on their blog section and began getting 404 errors when using the pagination links for categories, or posts by author. After doing some research the most…
    1
    2 3 4