WordPress.org

Forums

Icon in menu (7 posts)

  1. knuthbecker
    Member
    Posted 1 year ago #

    Hi Gurus,
    So I want to add an icon in one of the menupoints of my website but it doesn't work. I followed this guide but it still doesn't seem to work. Does anyone have an idea?

  2. Simon Vandereecken
    Inactive
    Posted 1 year ago #

    Is your change online ? Because I don't see any specific class in the menu

  3. esmi
    Forum Moderator
    Posted 1 year ago #

    You will probably need to start customising your theme's CSS - possibly via a child theme or a custom CSS plugin.

  4. alphaalec
    Member
    Posted 1 year ago #

    You could try this plugin: http://wordpress.org/plugins/menu-image/ I've used it on a project recently and it works well.

    Or you could use css to put a background image on the menu item in question using a :before or :after psuedoclass.

  5. knuthbecker
    Member
    Posted 1 year ago #

    I added this to Custom.css

    [ Moderator note: please wrap code in backticks or use the code button. ]

    .home-link-icon a{
    background-image:url(http://fiskeolien.dk/wp-content/uploads/2013/08/iconsmall.png) !important;
    background-repeat:no-repeat !important;
    background-position:center -47px;
    text-indent:-9999px;
    height: 52px;
    width: 35px;
    }

    And added this CSS class to the menupoint: home-link-icon

    But still doesn't work.

  6. esmi
    Forum Moderator
    Posted 1 year ago #

    Try using Firefox with the Firebug add-on for this kind of CSS troubleshooting. Or use whatever developer tool is available in your web browser.

  7. Simon Vandereecken
    Inactive
    Posted 1 year ago #

    You set a width and height for the entire link, not just for the image, removing the height & width and replacing with a padding-left:35px will do the trick :)

Topic Closed

This topic has been closed to new replies.

About this Topic