Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   New Versions, & Updating (http://forum.bytesforall.com/forumdisplay.php?f=12)
-   -   Making Atahualpa WP 3.0-ready for new menu function (http://forum.bytesforall.com/showthread.php?t=7177)

paulae May 19, 2010 06:53 AM

Making Atahualpa WP 3.0-ready for new menu function
 
I attended the NYC Wordpress Meetup last night, where 3.0 was outlined for us. I had already been testing 3.0beta2, so I knew about the new menu function. Essentially, it lets you combine pages, posts and outside URLs in one menu. If your theme is compliant, you can put the menu in the horizontal menu bar below the header. If the theme doesn't support this, you can use the menu as a sidebar widget.

I hope Flynn will make Atahualpa 3.4.9 support this wonderful feature. I'm sure he can figure it out from the Twenty-Ten theme, which is the new Wordpress default theme (no more Kubrick). This is some code from the new functions.php file. I'm not a PHP coder so this may not be all that's needed:
Code:

if ( ! function_exists( 'twentyten_page_menu_args' ) ) :
/**
 * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link
 */
function twentyten_page_menu_args($args) {
    $args = array(
        'sort_column' => 'menu_order, post_title',
        'menu_class'  => 'menu',
        'echo'        => true,       
        'show_home' => true       
    );
    return $args;
}
add_filter('wp_page_menu_args', 'twentyten_page_menu_args');
endif;


KatyDigg May 22, 2010 01:19 PM

Thank you, Paula

For valuable info! :)

juggledad May 31, 2010 06:58 AM

if you want to play with this new menu's here is an UNSUPPORTED change you can make to Atahualpa 3.5.1 so you can mess around with the new menus
1) edit function.php and change the last line (line 777) from
HTML Code:

?>
to
HTML Code:

add_theme_support( 'nav-menus' );
?>

2) edit header.php and change line 64 from
HTML Code:

                <?php bfa_header_config($bfa_ata['configure_header']); ?>
to
HTML Code:

                <?php bfa_header_config($bfa_ata['configure_header']); ?>
<?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_class' => 'menu-header' ) ); ?>

this will put the menu after Atahualpa's header in a <div class="menu-header"> that you can style.

This code will give you the first menu you defined, if you want another menu, change the line to
HTML Code:

                <?php bfa_header_config($bfa_ata['configure_header']); ?>
<?php wp_nav_menu( array( 'menu' => 'Project Nav', 'sort_column' => 'menu_order', 'container_class' => 'menu-header' ) ); ?>

where 'Project Nav' is the name of your menu

paulae May 31, 2010 07:18 AM

Close, but no cee-gar. I get this: http://gyazo.com/a46c3c654edec18528212c167263d643.png

I had gotten the same result a different way, but adding
Code:

// This theme uses wp_nav_menu()
add_theme_support( 'nav-menus' );

to functions.php, and
Code:

<php wp_nav_menu( 'id=navbar&menu_class=headermenu' ); ?>
to the theme options header config area after %image. Same thing happens in both cases: you get a vertical menu, not a horizontal menu bar. You can see the way the sidebar widget looks in the right sidebar.

juggledad May 31, 2010 07:45 AM

Eithor way will work. The ''container_class' => 'menu-header'' or 'menu_class=headermenu' specifies the class=.... that will be assigned to the menu, now you need to create the CSS to display it the way you want.

You can add CSS to style it using
.menu-header {.....} (or .headermenu {...} in your case)
and style it how you want. It won't pick up Atahualpa's menu styling you need to add your own for now


All times are GMT -6. The time now is 07:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.