Skip to content

Commit c4109a4

Browse files
zethzethpattonwebz
authored andcommitted
Add require to function (improved installation)
1 parent 26a280a commit c4109a4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ Place **class-wp-bootstrap-navwalker.php** in your WordPress theme folder `/wp-c
3737
Open your WordPress themes **functions.php** file - `/wp-content/your-theme/functions.php` - and add the following code:
3838

3939
```php
40-
// Register Custom Navigation Walker
41-
require_once get_template_directory() . '/class-wp-bootstrap-navwalker.php';
40+
/**
41+
* Register Custom Navigation Walker
42+
*/
43+
function register_navwalker(){
44+
require_once get_template_directory() . '/class-wp-bootstrap-navwalker.php';
45+
}
46+
add_action( 'after_setup_theme', 'register_navwalker' );
4247
```
4348

4449
If you encounter errors with the above code use a check like this to return clean errors to help diagnose the problem.

0 commit comments

Comments
 (0)