Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 380 Vote(s) - 3.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
wrong wp_nav_menu displayed

#1
my url looks like this:

[To see links please register here]


that page lists search results for "searchquery".

i then get the post type with

$post_type = $_GET['post_type'];

it echoes correctly

echo $post_type;
// Provides: qa_faqs

i then do an if/else to display a different menu via wp_nav_menu when $post_type is qa_faqs.

if ( $post_type == 'qa_faqs' ) {
echo 'we got qa_faqs over here';
wp_nav_menu(array('menu' => 'meta_menu', 'items_wrap' => '<dl id="%1$s" class="nice tabs vertical %2$s">%3$s</dl>', 'walker' => new sidenav_walker ));
} else {
echo 'no qa_faqs in da house';
wp_nav_menu(array('menu' => 'service_menu', 'items_wrap' => '<dl id="%1$s" class="nice tabs vertical %2$s">%3$s</dl>', 'walker' => new sidenav_walker ));
}

now to the funny part:

even though the page echoes 'we got qa_faqs over here', it displays the service_menu.

why´s that?
Reply

#2
I think you dont have any items on the meta_menu. Please create menu under Appearance section and assign it. :)
Reply

#3
Try targetting the specific menu with something like:

<?php wp_nav_menu( array('menu' => 'Your Menu Name' )); ?>
Reply

#4
Found it -

[To see links please register here]


Same problem was driving me nuts aswell.

Use 'theme_location' instead of 'menu' to point to which menu you want to output.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through