Skip to main content
Bumped by Community user
corrected spelling
Source Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244

My wordpress meneWordPress menu based on Twitter bootstrap creates menu-item and not page-item

As it says on the tin :)

I've got a dynamic menu being generated, but instead of generating a page-item it generates a menu-item instead. What I would like it to do is generate page-items and all the rest of it so that I can show or highlight the current page a user is visiting.

my code is :

header.php

// header.php

<?php // Loading WordPress Custom Menu
    wp_nav_menu( array(
        'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',
        'menu_class'      => 'nav navbar-nav',
        'menu_id'         => 'main-menu',
        'walker'          => new Cwd_wp_bootstrapwp_Walker_Nav_Menu()
) ); ?>

And then in the functions.php I have

add_action( 'after_setup_theme', 'cwd_wp_bootstrapwp_theme_setup' );
if ( ! function_exists( 'cwd_wp_bootstrapwp_theme_setup' ) ):
function cwd_wp_bootstrapwp_theme_setup() {
    // Adds the main menu
    register_nav_menus( array(
        'main-menu' => __( 'Main Menu', 'cwd_wp_bootstrapwp' ),
    ) );
}
endif;
add_action( 'after_setup_theme', 'cwd_wp_bootstrapwp_theme_setup' );

So any thoughts?

My wordpress mene based on Twitter bootstrap creates menu-item and not page-item

As it says on the tin :)

I've got a dynamic menu being generated, but instead of generating a page-item it generates a menu-item instead. What I would like it to do is generate page-items and all the rest of it so that I can show or highlight the current page a user is visiting.

my code is :

header.php

<?php // Loading WordPress Custom Menu
    wp_nav_menu( array(
        'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',
        'menu_class'      => 'nav navbar-nav',
        'menu_id'         => 'main-menu',
        'walker'          => new Cwd_wp_bootstrapwp_Walker_Nav_Menu()
) ); ?>

And then in the functions.php I have

if ( ! function_exists( 'cwd_wp_bootstrapwp_theme_setup' ) ):
function cwd_wp_bootstrapwp_theme_setup() {
// Adds the main menu
register_nav_menus( array(
  'main-menu' => __( 'Main Menu', 'cwd_wp_bootstrapwp' ),
) );
}
endif;
add_action( 'after_setup_theme', 'cwd_wp_bootstrapwp_theme_setup' );

So any thoughts?

My WordPress menu based on Twitter bootstrap creates menu-item and not page-item

I've got a dynamic menu being generated, but instead of generating a page-item it generates a menu-item. What I would like it to do is generate page-items and all the rest of it so that I can show or highlight the current page a user is visiting.

my code is :

// header.php

<?php // Loading WordPress Custom Menu
    wp_nav_menu( array(
        'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',
        'menu_class'      => 'nav navbar-nav',
        'menu_id'         => 'main-menu',
        'walker'          => new Cwd_wp_bootstrapwp_Walker_Nav_Menu()
) ); ?>

And then in the functions.php I have

add_action( 'after_setup_theme', 'cwd_wp_bootstrapwp_theme_setup' );
if ( ! function_exists( 'cwd_wp_bootstrapwp_theme_setup' ) ):
function cwd_wp_bootstrapwp_theme_setup() {
    // Adds the main menu
    register_nav_menus( array(
        'main-menu' => __( 'Main Menu', 'cwd_wp_bootstrapwp' ),
    ) );
}
endif;
Source Link

My wordpress mene based on Twitter bootstrap creates menu-item and not page-item

As it says on the tin :)

I've got a dynamic menu being generated, but instead of generating a page-item it generates a menu-item instead. What I would like it to do is generate page-items and all the rest of it so that I can show or highlight the current page a user is visiting.

my code is :

header.php

<?php // Loading WordPress Custom Menu
    wp_nav_menu( array(
        'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',
        'menu_class'      => 'nav navbar-nav',
        'menu_id'         => 'main-menu',
        'walker'          => new Cwd_wp_bootstrapwp_Walker_Nav_Menu()
) ); ?>

And then in the functions.php I have

if ( ! function_exists( 'cwd_wp_bootstrapwp_theme_setup' ) ):
function cwd_wp_bootstrapwp_theme_setup() {
// Adds the main menu
register_nav_menus( array(
  'main-menu' => __( 'Main Menu', 'cwd_wp_bootstrapwp' ),
) );
}
endif;
add_action( 'after_setup_theme', 'cwd_wp_bootstrapwp_theme_setup' );

So any thoughts?