You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,14 @@ A custom WordPress nav walker class to fully implement the Bootstrap 3.0+ naviga
14
14
15
15
This is a utility class that is intended to format your WordPress theme menu with the correct syntax and classes to utilize the Bootstrap dropdown navigation, and does not include the required Bootstrap JS files. You will have to include them manually.
16
16
17
+
### Bootstrap 4
18
+
19
+
Bootstrap 4 beta is available and is now the default branch offered at the GitHub repo and on [GetBootstrap](https://getbootstrap.com). A working version of the walker for Bootstrap 4 can be found in the `v4` branch.
20
+
21
+
Acording to @mdo & team:
22
+
23
+
> Long story short, shipping a beta means we’re done breaking all your stuff until our next major version (v5).
24
+
17
25
## Installation
18
26
19
27
Place **wp-bootstrap-navwalker.php** in your WordPress theme folder `/wp-content/your-theme/`
@@ -22,7 +30,19 @@ Open your WordPress themes **functions.php** file `/wp-content/your-theme/funct
If you encounter errors with the above code use a check like this to return clean errors to help diagnose the problem.
37
+
38
+
```php
39
+
if ( ! file_exists( get_template_directory() . 'wp-bootstrap-navwalker.php' ) ) {
40
+
// file does not exist... return an error.
41
+
return new WP_Error( 'wp-bootstrap-navwalker-missing', __( 'It appears the wp-bootstrap-navwalker.php file may be missing.', 'wp-bootstrap-navwalker' ) );
@@ -99,6 +119,20 @@ Review options in the Bootstrap docs for more information on [nav classes](https
99
119
100
120
To display the menu you must associate your menu with your theme location. You can do this by selecting your theme location in the *Theme Locations* list wile editing a menu in the WordPress menu manager.
101
121
122
+
### Making this Walker the Default Walker for Nav Manus
123
+
124
+
There has been some interest in making this walker the default walker for all menus. That could result in some unexpected situations but it can be achieved by adding this function to your functions.php file.
Simply updating the walker may not be enough to get menus working right, you may need to add wrappers or additional classes, you can do that via the above function as well.
135
+
102
136
### Extras
103
137
104
138
This script included the ability to add Bootstrap dividers, dropdown headers, glyphicons and disables links to your menus through the WordPress menu UI.
0 commit comments