WordPress.org

Forums

Feature request: Add css options to main menu (3 posts)

  1. antorera
    Member
    Posted 5 years ago #

    Would it be possible to add styles to individual menu options through the new MENU feature? For example, I just upgraded a theme from pre-WP3 to post-WP3 and lost something in the process. I would like to code an image or bar between my menu items and be able to have a different class on the first item so that the bar or image does not show to the left of it.

    For example, I want it to look like this:
    Home | About | News | Blog | Etc.

    However, I'm getting this:
    | Home | About | News | Blog | Etc.

    I don't want that bar to appear to the left of HOME. It would be great if I can attach a style to that particular menu option.

    Before it was possible to do manually in the header.php, but with the menu options, it's done automatically so it's not possible.

    Or, any other suggestions?

  2. New Nine Media
    Member
    Posted 5 years ago #

    You can already do this. When you go to Appearance->Menus, you should see a field called CSS Classes (optional) with each link. If you don't see this option, click Screen Options (top right of your dashboard) and select CSS Classes from the Show advanced menu properties section.

    Then, simply add a class to the first (or last or whatever) link and remove the bar, padding, etc.

  3. antorera
    Member
    Posted 5 years ago #

    This is fantastic! I just didn't see that. Thanks for your quick response.

Topic Closed

This topic has been closed to new replies.

About this Topic