S
S
Sergey Burduzha2018-04-23 22:13:34
WordPress
Sergey Burduzha, 2018-04-23 22:13:34

"Uncaught Error: Call to undefined function WP_Bootstrap_Navwalker()" error?

How to fix the error, like I did everything as described in the documentation.
Downloaded file from github
5ade2fa16e42a194777444.jpeg
Connected this file to functions.php

/**
 * Bootstrap nav walker.
 */
if ( ! file_exists( get_template_directory() . '/class-wp-bootstrap-navwalker.php' ) ) {
  // file does not exist... return an error.
  return new WP_Error( 'class-wp-bootstrap-navwalker-missing', __( 'It appears the class-wp-bootstrap-navwalker.php file may be missing.', 'wp-bootstrap-navwalker' ) );
} else {
  // file exists... require it.
  require get_template_directory() . '/inc/class-wp-bootstrap-navwalker.php';
}

I'm trying to call a class via var_dump in header.php
5ade301369002465996014.jpeg
Connected header via get_header() in index.php
How to get rid of the error?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
y0u, 2018-04-23
@serii81

As far as I understand, one needs to create an instance of the class, not just call it as a function.
what you have written below new WP_Bootstrap_Navwalker();is exactly what you need.

Сергей Бурдужа, 2018-04-23
@serii81 Автор вопроса

Все разобрался.
В этом коде
перед class нужно прописать /inc/class-wp-boot....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question