Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Dynamically change post query Re: Dynamically change post query

#67336
avandelay
Participant

Thanks Bob,

Do you know how I could make that work with a drop-down menu?
I would like to have a drop-down menu that contains a list of the months.
If the user selected “January” I would want the content on the page to reload, only showing posts from January.

I understand that in the drop-down menu, the name “January” would correspond to a value of 1; “February” to a value of 2, and so on.

I don’t know how to write code that would replace the current value of $monthvar in the query_posts(), when January is selected.
I also don’t know how to write code that would tell the browser to reload new content based on the new values in query_posts() after January is selected.

If anyone could provide me with some example code I would be greatly appreciative.

Thanks!