0

I wan't to use Bootstrap Navigation in Wordpress. I put bootstrap into the File functions.php. But the navigation even did not work (in header.php)?

This is where I want to add bootstrap:

<!-- site navigation menu-->
        <nav class="nav nav-pills site-nav">
            <?php wp_nav_menu(); ?>
        </nav><!-- site navigation menu-->
suther
  • 12,600
  • 4
  • 62
  • 99
  • We need to see more code to help you. Have you made sure that your bootstrap.min.css & your bootstrap.min.js are added in your project? – Tim Gerhard Oct 19 '17 at 06:06
  • Use brief and clear headings, don't put to much into the headline. You're posted code don't show anything about function.php or header.php. Be aware to describe all needed informations to make people able to help you. Add more Background-Information about. You fully missed to explain, that you talk about wordpress. How could other people know this?!? – suther Oct 19 '17 at 09:27

2 Answers2

0

brother you have to import bootstrap css in the style.css and it works fine in the template or for function.php

 function theme_styles() {

wp_enqueue_style( 'bootstrap_css', get_template_directory_uri() .    '/css/bootstrap-3.3.7.css' );
wp_enqueue_style( 'main_css', get_template_directory_uri() . '/style.css' );

}

add_action( 'wp_enqueue_scripts', 'theme_styles');

function theme_js() {

global $wp_scripts;

wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/js/bootstrap.min.js' );
wp_enqueue_script( 'my_custom_js', get_template_directory_uri() . '/js/scripts.js');

}

add_action( 'wp_enqueue_scripts', 'theme_js');

Radiant Ahmed
  • 191
  • 10
0

I can recommend wp-bootstrap-navwalker:

A custom WordPress nav walker class to fully implement the Twitter Bootstrap 3.0+ navigation style in a custom theme using the WordPress built in menu manager.

Check out the documentation:

https://github.com/wp-bootstrap/wp-bootstrap-navwalker

grusl83
  • 152
  • 1
  • 9