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
+48-48Lines changed: 48 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ A custom WordPress nav walker class to fully implement the Bootstrap 3.0+ naviga
12
12
13
13
## NOTES
14
14
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.
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. It does not include the required Bootstrap JS and CSS files. You will have to include those dependancies seporately.
16
16
17
17
### Bootstrap 4
18
18
@@ -29,13 +29,15 @@ Place **wp-bootstrap-navwalker.php** in your WordPress theme folder `/wp-content
29
29
Open your WordPress themes **functions.php** file `/wp-content/your-theme/functions.php` and add the following code:
If you encounter errors with the above code use a check like this to return clean errors to help diagnose the problem.
37
38
38
39
```php
40
+
<?php
39
41
if ( ! file_exists( get_template_directory() . '/wp-bootstrap-navwalker.php' ) ) {
40
42
// file does not exist... return an error.
41
43
return new WP_Error( 'wp-bootstrap-navwalker-missing', __( 'It appears the wp-bootstrap-navwalker.php file may be missing.', 'wp-bootstrap-navwalker' ) );
@@ -117,13 +116,14 @@ Review options in the Bootstrap docs for more information on [nav classes](https
117
116
118
117
### Displaying the Menu
119
118
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.
119
+
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 while editing a menu in the WordPress menu manager.
121
120
122
121
### Making this Walker the Default Walker for Nav Manus
123
122
124
123
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.
125
124
126
125
```php
126
+
<?php
127
127
function prefix_modify_nav_menu_args( $args ) {
128
128
return array_merge( $args, array(
129
129
'walker' => WP_Bootstrap_Navwalker(),
@@ -135,24 +135,24 @@ Simply updating the walker may not be enough to get menus working right, you may
135
135
136
136
### Extras
137
137
138
-
This script included the ability to add Bootstrap dividers, dropdown headers, glyphicons and disables links to your menus through the WordPress menu UI.
138
+
This script included the ability to add Bootstrap dividers, dropdown headers, glyphicons and disabled links to your menus through the WordPress menu UI.
139
139
140
-
### Dividers
140
+
####Dividers
141
141
142
142
Simply add a Link menu item with a **URL** of `#` and a **Link Text** or **Title Attribute** of `divider` (case-insensitive so ‘divider’ or ‘Divider’ will both work ) and the class will do the rest.
143
143
144
-
### Glyphicons
144
+
####Glyphicons
145
145
146
146
To add an Icon to your link simple place the Glyphicon class name in the links **Title Attribute** field and the class will do the rest. IE `glyphicon-bullhorn`
147
147
148
-
### Dropdown Headers
148
+
####Dropdown Headers
149
149
150
150
Adding a dropdown header is very similar, add a new link with a **URL** of `#` and a **Title Attribute** of `dropdown-header` (it matches the Bootstrap CSS class so it's easy to remember). set the **Navigation Label** to your header text and the class will do the rest.
151
151
152
-
### Disabled Links
152
+
####Disabled Links
153
153
154
154
To set a disabled link simply set the **Title Attribute** to `disabled` and the class will do the rest.
155
155
156
-
###Changelog
156
+
## Changelog
157
157
158
158
Please see the [Changelog](https://github.com/wp-bootstrap/wp-bootstrap-navwalker/blob/master/CHANGELOG.md).
0 commit comments