• Resolved scifizoe

    (@scifizoe)


    I want to add an image that is to the right of a link in the custom menus if they have an external link (_blank). I’ve tried a few things with the Walker but not having much success. I have multiple menus and trying to make this as easy as a ‘click’ for the end user. Thanks much!

    Added this after the walker

    wp_nav_menu( array('menu_class' => 'openLink',
                 'link_after' => '<div class="openLinkImg"></div>',
                 'walker'=> new MFC_Walker_Nav_Menu()
    ) );

    I had added ‘openLink’ to use as a trigger.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter scifizoe

    (@scifizoe)

    I believe what I am looking for is some sort of conditional if it’s an external link or if it has the ‘openLink’ class set. I realize that the above is not correct. Can you add a conditional like that?

    Thread Starter scifizoe

    (@scifizoe)

    Ah! very cool.. got it figured out using the Walker and setting a conditional if the target item is _blank! Worked like a charm.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding a div to external links in custom nav’ is closed to new replies.