ThemeShaper Forums » Thematic


nav menu args

(5 posts)
  • Started 10 years ago by kwight
  • Latest reply from kwight
  • This topic is not resolved


  1. kwight

    Hi everyone,
    I'm trying to insert an image tag after the anchor tag in nav menu items. This is what I have:

    function kwight_add_hover_image($args) {
            $themedir = get_bloginfo('stylesheet_directory');
            $args['after'] = '<img src="' . $themedir . '/images/menu_hover.png" />';
            return $args;
    add_filter( 'wp_page_menu_args', 'kwight_add_hover_image',11);

    Using $args['link_after'] and some dummy text works correctly; any idea why the above gives me nothing? Is there a better way to do this?..

    Posted 10 years ago #
  2. does anything appear in the source code?

    Posted 10 years ago #
  3. kwight

    No... but simply changing ['after'] to ['link_after'] works perfectly - odd. Could there be something later on that would set this value back to empty? Grasping at straws here...

    Posted 10 years ago #
  4. well according to the codex:

    'link_after' is the name of the argument and there is no mention of 'after'

    Posted 10 years ago #
  5. kwight

    Ah, 'after' is a wp_nav_menu argument; will do more testing

    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.