I really need help for this problem in wordpress about displaying and filtering datas. I have html in this form, so first i have two drop down list(DDL), which should be populated related to the date of the posts. First DDL it should contains all the years of the posts, and second DDL should contains all the months of the posts.
<select name="month">
<option value="2001"> 2001</option>
<option value="2002"> 2002</option>
<option value="2003"> 2003</option>
<option value="2004"> 2004</option>
<option value="2005"> 2005</option>
<option value="2006"> 2006</option>
<option value="2008"> 2008</option>
<option value="2000"> 2000</option>
</select>
<select name="month">
<option value="January"> 01 </option>
<option value="Feburary"> 02 </option>
<option value="March"> 03 </option>
<option value="April"> 04 </option>
<option value="June"> 06 </option>
<option value="July"> 07 </option>
<option value="August"> 08 </option>
<option value="December"> 12 </option>
</select>
Now I need to display the posts by selecting in DDL, month and year. I'm using while loop to display all the posts. Something like this:
<?php
$posts_per_row = 3;
$posts_per_page = 6;
$category_name = 'music';
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'category_name' => $category_name,
'posts_per_page' => $posts_per_page,
'paged' => $paged,
);
query_posts($args);
if (have_posts()) {
while (have_posts()) {
the_post();
....
}
} else {
....
}
?>
The template also has the pagination function in functions.php