I'm a super newbie, so I'll try my best to explain.
I have a blog page that I wanted filtered by category and I want the user to able to click on multiple categories and it will filter to show those posts.
I figured out how to do one post category, I just don't know how to keep the value that has already been clicked and add another value.
What I have now
What I think I'm looking for
Nav
<form action="/blog" method="get">
<ul class="show">
<li><button name="filter" type="submit" value="all">All</button></li>
<li><button name="filter" type="submit" value="issues" class="active">Issues</button></li>
<li><button name="filter" type="submit" value="members-voice">Member's Voice</button></li>
<li><button name="filter" type="submit" value="politics">Politics</button></li>
<li><button name="filter" type="submit" value="voices">Voices</button></li>
</ul>
</form>
How I query posts
<?php $query = "";
if ($_GET['filter'] == 'all') {
$categories = get_categories( $args );
foreach ($categories as $category) {
$fliterArray[] = $category->slug;
$query = implode(",", $fliterArray);
}
} else {
$query = $_GET['filter'];
}
?>
<ul>
<?php $args = array(
'post_type' => array('slideshow_article','interior'),
'category_name' => $query, // This needs to be either one Categorie or a few Categorie or All Categorie
'posts_per_page' => 1000,
'meta_query' => array(
array(
'key' => 'hide_feed', // name of custom field
'value' => '0',
)
),
); ?>