Change variable for query with dropdown menu
-
Hi all,
in this page: https://isonomia.uji.es/comunicados/
I use this code, to show the posts of the category “isonomia” in a year:
<?php $year = date('Y'); $catquery = new WP_Query( "category_name=isonomia&year=$year" ); while($catquery->have_posts()) : $catquery->the_post(); ?> <?php the_time('Y-m-d'); ?> - <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a><br /> <?php endwhile; ?>
I want a dropdown menu in the footer to change the $year variable to show other year posts with the category “isonomia”. Is it possible?
I don’t want to use the wp_get_archieves because it shows with a other template… I only find likely solutions with forms POST GET
Thanks for your replies.
- The topic ‘Change variable for query with dropdown menu’ is closed to new replies.