As the title says, I’m having a hard time making the bootstrap menu responsive. As I am using wordpress I’m calling bootstrap.js etc in functions.php. Can anyone help me? Live example
header.php

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="description" content="">
  <meta name="author" content="">
    <title><?php bloginfo('title') ?></title>
    <?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>

  <nav class="navbar navbar-default navbar-custom navbar-fixed-top">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-nav" aria-expanded="false"> <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>

      </button>
    </div>
    <div class="collapse navbar-collapse" id="bs-nav">
      <ul id="#nav menu" class="nav navbar-nav navbar-right">
    <li data-menuanchor="secondPage"><a href="#secondPage">BARBEQUE</a></li>
    <li data-menuanchor="3rdPage"><a href="#3rdPage">TRAITEUR</a></li>
    <li data-menuanchor="4thPage"><a href="#4thPage">CATERING</a></li>
    <li data-menuanchor="5thPage"><a href="#5thPage">VERHUUR</a></li>


      </ul>
    </div>
  </div>
    </nav> 

functions.php

<?php

/*
    =====================================
    js + css intialization
    =====================================
*/

add_action( 'wp_footer', 'print_my_inline_script' );

function ms_script_enqueue() {

  wp_enqueue_style('customstyle', get_template_directory_uri() . '/css/css.css', array(), '1.0.0', 'all');
  wp_enqueue_style('customstyle2', get_template_directory_uri() . '/css/custom.css', array(), '1.0.0', 'all');
  wp_deregister_script( 'jquery' );
  wp_register_script( 'jquery', includes_url( '/js/jquery/jquery.js' ), false, NULL, true );
  wp_enqueue_script( 'jquery' );
  wp_enqueue_script('customjs', get_template_directory_uri() . '/js/js.js', array(), '1.0.0', 'true');
  wp_enqueue_script('bootstrap_js', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '1.0.0', 'true');
  wp_enqueue_script('lazysizes', get_template_directory_uri() . '/js/lazysizes.min.js', array(), '1.0.0', 'true');
  wp_enqueue_style( 'font-awseome', get_stylesheet_directory_uri().'/css/font-awesome.min.css' );
    wp_enqueue_style( 'fullpage-css', get_stylesheet_directory_uri() . '/css/jquery.fullPage.css');
    wp_enqueue_script('fullpage-js', get_stylesheet_directory_uri() . '/js/jquery.fullPage.js', array('jquery'));
    wp_enqueue_script('fullpage-initialize', get_stylesheet_directory_uri() . '/js/fullpage.initialize.js', array('jquery'));



  wp_enqueue_script( 'html5shiv', get_template_directory_uri() . '/js/html5shiv.js' );
  wp_script_add_data( 'html5shiv', 'conditional', 'lt IE 9' );
  wp_enqueue_script( 'respond', get_template_directory_uri() . '/js/respond.min.js' );
  wp_script_add_data( 'respond', 'conditional', 'lt IE 9' );

}
add_action('wp_enqueue_scripts', 'ms_script_enqueue');
/*
    =====================================
    Menu's
    =====================================
*/

function mytheme_setup() {

register_nav_menus(
array(
'footer_nav' => __( 'Footer Menu', 'bootpress' ),
'top_menu' => __( 'Top Menu', 'bootpress' )
)
);

}
add_action( 'after_setup_theme', 'mytheme_setup' );

/*
    =====================================
    Custom sidebar
    =====================================
*/

function ms_widget_setup() {
  register_sidebar(array(
      'name'  =>  'Sidebar',
      'id'  =>  'sidebar-1',
      'class' => 'custom',
      'description' => 'Custom Sidebar'
  )
);
}
add_action('widgets_init','ms_widget_setup');
add_theme_support( 'post-thumbnails', array( 'post', 'page' ) );

?>

Thanks in advance.

Read more here: Twitter bootstrap menu does not collapse


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: