-
AuthorPosts
-
October 2, 2013 at 2:48 pm #169353
I’ve added icons in the past adding custom-classes for menu items in WordPress and then through css
ul#menu-navigation li:before {position: absolute; font-family: ‘entypo-fontello’; padding-left: 0.7em; width: 1.4em;}
and then
li.the-custom-class-menu-item:before{content: ‘⌂’;”}it doesn’t seem to work anymore, any best practice ?
should we repurpose the <span class=”avia-bullet”></span>October 3, 2013 at 9:04 am #169808Hi pharefm!
Afaik the new icon font system does not allow you to add an icon this way because the user can upload custom font sets and Kriesi uses the data attribute to select the right font set. I’d suggest to use the “icon” shortcode to add an icon to the menu title/link. Right now the menu title does not support shortcodes but we’ll add this feature in the next version. For now you need to modify /wp-content/themes/enfold/includes/helper-responsive-megamenu.php manually – open up the file and replace
$heading_title = $title;
with
$heading_title = do_shortcode($title);
and
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
with
$item_output .= $args->link_before . do_shortcode(apply_filters('the_title', $item->title, $item->ID)) . $args->link_after;
and then you should be able to use the icon shortcodes in the menu title field too. Use the “Magic wand” to generate the icon shortcode.
Best regards,
PeterOctober 3, 2013 at 2:36 pm #169949hmm,
it’s being used inside base.css :.image-overlay .image-overlay-inside:before{content:”\E869″; font-family: ‘entypo-fontello’; font-size: 18px; font-weight: normal; }
October 3, 2013 at 2:46 pm #169954Hi!
Yes, but it’s better to use the shortcode because if you upload a custom font the font family can be different. Kriesi uses the css code for some standard icons only. It’s also more user friendly because for the css solution you need to know the character code of the icon whereas the shortcode generator will take care of it and display the icons in a grid and you can simply select them with a click.
Best regards,
PeterOctober 3, 2013 at 8:37 pm #170064should this also work for the footer menu?
-
AuthorPosts
- The topic ‘Best way to add icons to the top level menu’ is closed to new replies.