• Hi wordpress people! I’m reassembly new to WordPress and would like to know is there any way to add svg(scaleable vector graphics) to a wp menu?

    I’m wanting to add four Icomoon svg to my Home, About, Products and Contact buttons in my wp menu.

    any help would be greatly appreicated ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • Can’t these be added as background images using css?

    Thread Starter arrrg…

    (@arrrg)

    I think that would mean using an image file like jpg or png. I want to add it as an icon font using this in my css.

    @font-face {
    	font-family: 'IcoMoonRegular';
    	src: url('icomoon-webfont.eot');
    	src: url('icomoon-webfont.eot?#iefix') format('embedded-opentype'),
    		url('icomoon-webfont.woff') format('woff'),
    		url('icomoon-webfont.ttf') format('truetype'),
    		url('icomoon.svg#IcoMoon') format('svg');
    	font-weight: normal;
    	font-style: normal;
    }
    .icon-b:before, .icon-a:after {
    	font-family: 'IcoMoonRegular';
    	content: attr(data-icon);
    }

    then calling it in html with
    <p class="icon-b" data-icon="?"><a href="#">Home</a></p>

    The data-icon attribute gets filled with which ever snippet of code relates to that icon in your svg font.

    this isn’t too difficult i’m just stumped as to applying it to a wp_menu

    If you’re not going to change your menu that ofen, I would just hard code it in the header.php instead of using the wp_list_pages function.

    Thread Starter arrrg…

    (@arrrg)

    I’ll probably have to do that for now. I don’t know enough php to create a menu walker that can deal with this ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add svg to wp menu’ is closed to new replies.