How to display menu using WP_Query?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
16 views
Hello, is it possible the query using WP_Query to access a menu that is going in the admin panel and displayed using wp_nav_menu()? If possible, give an example of a query.
by | 16 views

2 Answers

0 like 0 dislike
Like he was pokazalsya. If you know the id menu, you can get an array of objects using
wp_get_nav_menu_items( 3, array( 'update_post_term_cache' => false ) )

This is an example. The second argument only, tell me, who knows. Just on the website there will be several menus with different markings. You like to control everything completely.
by
0 like 0 dislike
What you want to control?
You may want to customize the menu using the walker. And for each menu ask your walker.
An example of a Walker for bootstrap menu https://github.com/wp-bootstrap/wp-bootstrap-navwalker

But using WP_Query in any way. It for another need.

You can still pay attention to wp_get_nav_menu_object()
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
asked Jun 13, 2019 by ligisayan
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
110,608 questions
257,187 answers
0 comments
40,796 users