ThemeShaper Forums » Thematic

[closed]

nav menu args

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

Tags:

  1. kwight
    Member

    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?..
    Thanks

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

    Posted 3 years ago #
  3. kwight
    Member

    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 3 years ago #
  4. well according to the codex:
    http://codex.wordpress.org/Function_Reference/wp_page_menu

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

    Posted 3 years ago #
  5. kwight
    Member

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

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.