I have a page divided in two bars.
- The left bar is a side menu, which shows contents for a specific country (ie: if I am in the Mexico page, there are options listing Cancun, Acapulco, Mexico City... if I am in Italy page, there are options listing Rome, Milan, Florence and so on);
- The right bar is the full content, that display the pack information of the destination, so if I am in the Italy page and click on Rome, the user will see in this right bar all the information regarding prices, flights, sightseeing and so on;
I have to match these two bars each other. When I am checking the content of the destination in the right bar, the left bar should match the correct menu country.
The way I analyzed it was applying taxonomies for the menu and for the pack information. So, when I am making a page for Rome, I apply the "Italy" taxonomy, or if I am making a page for Cancun, I apply the "Mexico" taxonomy and so on for many other destinations I have.
That is the way I am querying the left bar/side menu (content-sidemenu.php)
<?php $args = array( 'post_type' => 'side_menu', 'posts_per_page'=> 1, 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'countries', 'field' => 'slug', 'terms' => array( **??????** ) ) ) ); $the_menu = new WP_Query( $args ); if ( have_posts() ) : while ( $the_menu->have_posts() ) : $the_menu->the_post(); ?> ?>
The right bar is slightly similar (just the
post_type has different values depending on the page), but the
tax_query is the same. So, how could I make them match??