Navigation tag and dropdowns in an archive template
-
Hello,
1rst, I’m a newbie, so this topic is quite simple for old members, I guess.
My project ist to create a directory of people working together as a tools for finding informations.
I created a custom post type for “Staff Members”. I also created two custom taxonomies for sorting them : some “Keywords” and working “Themes”.
In an new archive template I want to display the 3 type of informations.
Here’s a screencap of the page running under MAMP localy:
(right click > open image in a new tab for a better vision).
In Zone 1 & 2, I use the following code :
<div id="staff-keywords" class="col span_1_of_2"> <h2 class="title-info-staff-member"><?php _e( 'Keywords:' ); ?></h2> <form id="category-select" class="category-select" action="<?php echo esc_url( home_url( '/' ) ); ?>" method="get"> <?php wp_dropdown_categories( 'show_count=1&taxonomy=sm_keywords' ); ?> <input type="submit" name="submit" value="view" /> </form> <br /></div>
The problem is : when I choose a keyword or a theme the right page (with a slug as selected) is displayed. Where am I wrong. I guess it should be fairly simple.
In zone 3, I use the following code :
<div id="list-staff-members" class="clear directory"><!--START listing Staff Members--> <?php // query $the_query = new WP_Query(array( 'post_type' => 'staffmembers', 'posts_per_page'=> 5, 'meta_key' => 'sorting_key', 'orderby' => 'meta_value', 'order' => 'ASC' )); ?> <?php if( $the_query->have_posts() ): ?> <h2 class="title-info-staff-member">Staff Members</h2> <ul> <?php while( $the_query->have_posts() ) : $the_query->the_post(); $class = get_field('sorting_key') ? 'class="sorting_key"' : ''; ?> <li <?php echo $class; ?>> <h2 class="the-staff-member-name-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p> <?php echo get_the_term_list($post->ID, 'sm_keywords', '<span class="obvious-element-staff-member">Keywords : </span>', ', ' ,'') ?> <br /> <?php echo get_the_term_list($post->ID, 'primary_theme', '<span class="obvious-element-staff-member">Theme : </span>', ', ' ,'') ?> </p><br /> </li> <?php endwhile; ?> </ul> <!--page links--> <?php echo paginate_links (); ?> <?php endif; ?> <?php wp_reset_query(); // Restore global post data stomped by the_post(). ?> <?php else : ?> <?php get_template_part( 'content', 'staffmember_detail' ); ?><!--list each staff member details--> <?php endif; ?> </div><!-- END Staff Members listing -->
In this case, when I select another page with the
<?php echo paginate_links (); ?>
, the URL changes accordingly but not the five Staff Members informations.
Let’s say I click on page two and the same list of five Staff Members remains.Here again, I guess the solution is quite simple. I’dlike to learn more with thoses cases.
Is anybody have a solution?
Many THX in advance. Have a good WE.V.
- The topic ‘Navigation tag and dropdowns in an archive template’ is closed to new replies.