SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    724
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    primary links in nav not linking

    Hello all. Can't understand why the top lelvel/primary nav links are not active.
    This is wordpress. In my experience that is automatic.
    http://danielamorescalchi.com/testar.../nav-menus.php

    How could i go about fixing this please?
    thx
    D

  2. #2
    SitePoint Addict deadmix's Avatar
    Join Date
    Jun 2009
    Location
    france
    Posts
    210
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    did you create the Menu and Manage the Location of it !?

    is the theme you use support this Function !?

    which theme you use !?

  3. #3
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    724
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    gm deadmix!
    yes i created the menu and managed the location.
    yes it should support it just fine.
    I use a child of twentyfourteen w/boostrap so this bit of code was added to the child theme's functions.php
    Code:
    add_action( 'wp_enqueue_scripts', 'apd_scripts' );
    remove_filter ('the_content', 'wpautop');
    
    if ( ! function_exists( 'apd_scripts' ) ):
        function apd_scripts() {
          // Adds the main menu
          register_nav_menus( array(
            'main-menu' => __( 'Main Menu', 'cwd_wp_bootstrapwp' ),
          ) );
        }
      endif;
      add_action( 'after_setup_theme', 'apd_scripts' );
      ////
      // Register Custom Navigation Walker
    require_once('wp_bootstrap_navwalker.php');
    register_nav_menus( array(
        'primary' => __( 'Primary Menu', 'apdSilencers' ),
    ) );

    and this page (added link, lots of code. was having prob uploding it as an attachment) https://github.com/twittem/wp-bootst..._navwalker.php
    to the ct, wp_bootstrap_navwalker.php
    thx
    D

  4. #4
    SitePoint Addict deadmix's Avatar
    Join Date
    Jun 2009
    Location
    france
    Posts
    210
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    hello,

    First just follow this steps : Link You don't need to use a lot of codes on the functions.php file, you simply have to Replace in the Header.php :

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

    With :

    <?php
    wp_nav_menu( array(
    'menu' => 'primary',
    'theme_location' => 'primary',
    'depth' => 2,
    'container' => 'div',
    'container_class' => 'collapse navbar-collapse',
    'container_id' => 'bs-example-navbar-collapse-1',
    'menu_class' => 'nav navbar-nav',
    'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
    'walker' => new wp_bootstrap_navwalker())
    );
    ?>

    and then Register it on the Functions.php

    ... When everything Work, you style your Menu the way you want to..

    Goodluck

  5. #5
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    724
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I'll go check...but think i already have.
    D

  6. #6
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    724
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    yep. already did that...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •