Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Help with Nav Menu Hover – HTML

Discussion in 'Misc WordPress Requests' started by bcworkz, Feb 21, 2018.

  1. bcworkz


    Reply To: Help with Nav Menu Hover – HTML, by bcworkz

    Yes, an idea is about all though. PHP required, CSS wouldn’t cut it. It’d take a good bit of trial and error for me to arrive at the proper regexp and replacement. TBH, I was hanging back, hoping someone better with regexp would chime in. Here’s the rest of it except the regexp and replacement.

    add_filter( 'wp_nav_menu_items', 'h12_menu_mod', 10, 2);
    function h12_menu_mod( $items, $args ) {
    $new = array();
    foreach ( $items as $item ) {
    $new[] = preg_replace( '???regexp???', '???replacement???', $item );
    return $new;

    It’s a start at least. If you want to experiment with regexps to figure out what works, try regexr.com. Or maybe someone else can chime in with some regexp help.

    Reply To: Help with Nav Menu Hover – HTML

Share This Page

Monarch Social Sharing Plugin