• Hey guys, I have just learnt how to create a nav menu using wordpress functions: http://codex.wordpress.org/Navigation_Menus

    My menu looks like this:

    <ul class="menu"> <!-- First Menu -->
    	<li> <a href="#"> Clients </a> </li>
    	<li> <a href="#"> About Us </a> </li>
    	<li class="contact"> Contact </li>
    	<li class="hasImage"> <a href="*link to the homepage**"> <img src="http://xxx.com/wp-content/themes/twentyfifteen-child/images/logo.png" class="logo"> </a> </li>
    </ul>

    The last <li> tag contains an image. and shows up in all list items.
    How do I add the image in the <li>

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I don’t understand your question. If all list items have the image, why would you want to add it, if it’s already there?

    FYI, there’s a number of filters applied by wp_nav_menu(), you can use one of them to alter the menu in any number of ways. It’s best to view the source code to see what filters are available and how they are applied.

    To add the same image to all <li> elements, instead of using filters, you might consider using a CSS pseudo-element such as ::before or ::after.

Viewing 1 replies (of 1 total)
  • The topic ‘How to add an additional to every menu I create’ is closed to new replies.