I'm still fairly new to the wonderful world of WordPress development and was hoping for help with a question..
I've got a simple page template which extracts all posts under a certain category and shows them in a defined order. All well and good, but what I'd like to do is add a filter so the user can select a child category from the list and then the page will refresh with just posts from the child category showing.
The Codex has a suggestion involving the
wp_dropdown_category() function, but the action from that takes you to the category archive which I don't want; I need to keep the user within the page.
I use :
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $args = array ( 'cat' => 1, 'posts_per_page' => 10, 'paged' => $paged ); $query = new WP_Query( $args );
for the original selection and had in mind changing
'cat' => to the selected output from the list but can't get it right.
Any help gratefully appreciated!