WordPress.org

Ready to get started?Download WordPress

Forums

cant get wordpress wp sub menus (8 posts)

  1. graham85
    Member
    Posted 1 year ago #

    hi im trying to add submenu on my menu but it wont happen. have you any ideas how to resolve im using a free theme called flexor magazine.
    ive been in the theme options and tfunctions but no look
    thanks in advance

  2. Andrew Bartel
    Member
    Posted 1 year ago #

    Is the menu you're trying to edit available to edit under Appearance > Menus?

  3. graham85
    Member
    Posted 1 year ago #

    no. i placed the one page under the other to create a sub menu but it didnt appear at all.

    my functions.php looks like like this

    // This theme uses wp_nav_menu() in one location.
    register_nav_menus( array(
    'primary-menu' => __( 'Primary Menu' ),
    'secondary-menu' => __( 'Secondary Menu' ),
    ) );
    function my_wp_nav_menu_args( $args = '' )
    {
    $args['container'] = false;
    return $args;
    } // function
    add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );

    and my themeoptions.php looks like this:

    array( "name" => "Menu settings",
    "type" => "heading",
    "desc" => "Here you can exclude some of the links in the menus of theme.",
    ),

    array( "name" => "Exclude pages",
    "desc" => "You can exclude some of the links in the pages menu (comma separated if more than one!).",
    "id" => $shortname."_pages",
    "std" => "",
    "type" => "text"),

    array( "name" => "Exclude categories",
    "desc" => "You can exclude some of the links in the categories menu (comma separated if more than one!).",
    "id" => $shortname."_categories",
    "std" => "",
    "type" => "text"),

    array( "name" => "Miscellaneous",
    "type" => "heading",
    "desc" => "Here you can exclude some of the links in the menus of theme.",
    ),

  4. graham85
    Member
    Posted 1 year ago #

    and this is in the header.php

    <?php if ( has_nav_menu( 'secondary-menu' ) ) { //checks if custom menu has been created
    wp_nav_menu( array( 'menu_class' => 'sf-menu', 'theme_location' => 'secondary-menu' ) );
    } else {// if not, old fashioned category menu will be loaded
    ?>
    <ul class="sf-menu">
    <?php $cat = get_option('swt_categories'); ?>
    <li class="category_item <?php if(is_home()) { echo 'current-menu-item first'; } ?>">" id="home">Home
    <?php wp_list_categories("title_li=&depth=1&exclude=$cat" ); ?>

    <?php } ?>

  5. graham85
    Member
    Posted 1 year ago #

    and this is the css.

    #nav2 {
    clear: both;
    height: 45px;
    width: 1000px;
    background: url(images/nav.png) no-repeat;
    margin-bottom: 35px;
    overflow: hidden;
    }
    #nav2 li {
    float: left;
    line-height: 45px;
    margin-right: 1px;
    }
    #nav2 li a {
    float: left;
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 0px 22px;
    font-size: 12px;
    text-transform: uppercase;
    font-family: 'PTSansNarrowBold';
    text-shadow: 1px 0 1px #000000;
    }
    #nav2 li.current-menu-item, #nav2 li:hover, #nav2 li.current-cat {
    background: url(images/navh.png) repeat-x;
    }
    #nav2 li.first a, #nav2 li.first a:hover, #nav2 li.firstac a {
    background: url(images/first-active.jpg) no-repeat scroll left !important;
    }
    #nav2 li li {
    display: none;
    }

  6. Andrew Bartel
    Member
    Posted 1 year ago #

    Well your theme is registering two nav menus. Are those not in the right place? You can create a menu and then place it in one of the two registered areas. That menu should support hierarchical structures.

  7. graham85
    Member
    Posted 1 year ago #

    i created a menu but it wont support subpages

  8. Andrew Bartel
    Member
    Posted 1 year ago #

    In what way? Do they not add to the menu? Can you not set them as children (drag and drop so that they're indented)?

Topic Closed

This topic has been closed to new replies.

About this Topic