• Resolved isonychia

    (@isonychia)


    My theme, Black Lucas does not support menus. Which is what I figure I need to add my blog categories to my hroizontal navigation. I want my “blog” nav item to show a drop down of the categories. I can do it with regular pages but not my blog.

    I have searched for a way to add support for the menus option.

    I tried several, heres one http://www.logon.ie/blog/add-custom-menu-to-theme and a few work BUT it doesn’t keep the styling of my already present navigation. All I get is a vertical navigation menu in place of my already styled navigation. Most of it is hidden behind my other content.

    What am I missing and where do I fix this.

    Thanks
    iso

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter isonychia

    (@isonychia)

    Any help on this?
    Thanks
    iso

    Thread Starter isonychia

    (@isonychia)

    Nevermind I got it to work using these two pieces of code below. Somehow this option kept the styling of my already created nav.

    “Simply add the code below to your theme’s functions.php file:”

    add_theme_support( 'menus' );

    Once you have enabled the feature, now you can add it in your theme. These menus are not limited for header.php file only. You can add them anywhere you like to fit your design’s need by pasting the code below:

    <?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_class' => 'menu-header' ) ); ?>

    Have a look at the arguments you can pass to wp_nav_menu() you need to pass in the classes for your existing menu for the same styling.

    Look at the descriptions and these defaults.

    'container'       => 'div',
    'container_class' => 'menu-{menu slug}-container',
    'container_id'    => ,
    'menu_class'      => 'menu',
    'menu_id'         => ,
    'before'          => ,
    'after'           => ,
    'link_before'     => ,
    'link_after'      => ,
    'items_wrap'      => '<ul id=\"%1$s\" class=\"%2$s\">%3$s</ul>',

    If you have a link to your existing theme then in the page source it would be easy to find the classes to construct the arguments.

    Here is an example from an old Artisteer generated theme:

    <?php wp_nav_menu( array(
       'sort_column' => 'menu_order',
       'theme_location' => 'primary',
       'menu_class' => 'art-menu'
    ) ); ?>

    All we have done here is told WordPress to use the class art-menu there is a lot more with artisteer as it uses images so this a cut down version.

    Without links it is hard to offer help!

    David

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘adding menu support, styling missing’ is closed to new replies.