Fatal error: Uncaught Error: Call to undefined function wp_nav_menu()

I am getting this error which

Fatal error: Uncaught Error: Call to undefined function wp_nav_menu()
in
/home/stageidg/public_html/idg/wp-content/themes/idg-child/secondmenu.php:2
Stack trace: #0 {main} thrown in
/home/stageidg/public_html/idg/wp-content/themes/idg-child/secondmenu.php
on line 2

line 2 in the php file is this:

wp_nav_menu( array(‘menu’ => ‘Services’, ‘theme_location’=>’services’ ) );

and its being called by this jquery code:

$.ajax(
{
url: “http://example.com/idg/wp-content/themes/idg-child/secondmenu.php”, // path to your PHP file
dataType:”html”,
success: function(data)
{

$(data).appendTo(inner_overlay); // load-into-div is the ID of the DIV where you load the <select>

} // success
}); // ajax

any idea? what am i doing wrong?

Read more here:: Fatal error: Uncaught Error: Call to undefined function wp_nav_menu()

Leave a Reply

Your email address will not be published. Required fields are marked *