0

What i am trying to do is display a specific image along with the text returned from wp_nav_menu. I basically want to have images in the background according to the menu option. For example, if the text is About then About.png will be displayed in the background. This is easy in PHP but now switching to WordPress, not easy at all.

So far i have accomplished this by putting html of specific images in the Menu Structure>Navigation label.enter image description here

Is there another way to accomplish this? I want it to be easy enough that a casual user could upload a different About.png into the media library and different image will be shown with the About text. Doing it the way i've done, the user would have to know HTML code.

Here is my wp_nav_menu

wp_nav_menu( array( 'theme_location' => 'main-menu'));

Again, how do i display an image from the media library with the text returned from wp_nav_menu?

If this involves a Custom Walker, could i have an example please.

4

0 に答える 0