• I’m using the antisnews theme on WordPress 3.0, and am trying to add menu support.

    What snippet should I place in my function.php folder?

    I believe this is the related code in the header.php

    </div>
    <div id="antisnav-navbar">
    
    	<ul id="antisnav">
    		<li<?php if ( is_home() ) { ?> class="current_page_item"<?php } ?>><a href="<?php echo get_option('home'); ?>"><?php _e("Home",'Antisnews');?></a></li>
    		<?php if( current_user_can('manage_options')  && $AntisnewsOptions[$themeoptionsprefix.'_hideaddpostlink'] == 'show' )  { ?> <li><a href="<?php echo get_option('home'); ?>/wp-admin/post-new.php"><?php _e("Add Post","Antisnews");?></a></li> </a> <?php } ?>
    		<?php $excludepagepostid=$AntisnewsOptions[$themeoptionsprefix.'_pagecatidstoexclude']; if(!isset($excludepagepostid) || empty($excludepagepostid)){$excludepagepostid='';}?>
    		<?php 	if( $AntisnewsOptions[$themeoptionsprefix.'_pagesorcategories'] == 'pages'){ wp_list_pages('title_li=&sort_column=menu_order&exclude='.$excludepagepostid); } 	elseif( $AntisnewsOptions[$themeoptionsprefix.'_pagesorcategories'] == 'categories'){ wp_list_categories('title_li=&sort_column=menu_order&exclude='.$excludepagepostid);} else{ wp_list_pages('title_li=&sort_column=menu_order&exclude='.$excludepagepostid);}?>
    	</ul>
    <div class="clear"></div>
    </div>

    Which portion should I replace and with what code?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter cooperasmith

    (@cooperasmith)

    I took this from the default 3.0 theme
    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>

    Is this the exact line I should place in my own theme’s header.php? I’m just not certain of correct placement…

    You need code in two places – in your functions.php, something like this (from Twenty Ten)

    // This theme uses wp_nav_menu() in one location.
    	register_nav_menus( array(
    		'primary' => __( 'Primary Navigation', 'twentyten' ),
    	) );

    AND the actual code that generates the div/unordered list of menu items as you already found. That code can pretty much replace the old code used to generate the unordered list.

    Tisha Oehmen

    (@paraduxmedia)

    Cooper.a.Smith were you ever able to get this to work? I’m trying to do the same thing and can get the menu to display but loose all the styling.

    It worked for me. Just as wpweaver said, you use the code cooper.a.smith listed in the second post, in header.php, replacing the code for the antisnews navbar (div id="antisnav-navbar") between the unordered list tags <ul id="antisnav"> and </ul>

    And to register the WordPress navigation insert the code that wpweaver posted, putting it just above the series of sidebar registrations in functions.php.

    Hope this helps.

    New problem.

    Once you have Antisnews start using the WordPress navagation, you can not use the antisnews css style tool to style it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Navigation Menu’ is closed to new replies.