I want Display in Services with a dropdown option list of category names on the top and when i select on any one category name, it would display His Custom posts in Services page on specific col-md-4 without refreshing. Is this possible in Wordpress?
<html>
<body>
<!----HTML Code Below--->
<div class="infoflowing-style">
<div class="infoflowing-style"><div class="infoflowing-style">
<!--select custom_category -->
<select>
<option value="custin category id">Custom category 1</option>
<option value="custin category id">Custom category 2</option>
</select>
</div>
</div>
<!--Display select (custom_category) All Post-->
<div class="infoflowing-style">
<div class="infoflowing-style">
<img src="image_url_1">
<h6>Post name 1</h6>
</div></div>
<div class="infoflowing-style">
<div class="infoflowing-style">
<img src="image_url_2" />
<h6>Post name 2</h6>
</div></div>
<div class="infoflowing-style">
<div class="infoflowing-style">
<img src="image_url_3" />
<h6>Post name 3</h6>
</div></div></div></div>
</body></html>
Comments
In case it helps anyone... I wasn't able to find an elegant way to incorporate this additional filter into my query, but because the custom post type for this project will have very few ( less than 30 ) posts, I opted to simply add an IF statement inside my loop to filter for only posts matching the
case_study
field:It feels clunky to me to do it this way rather than finding a way to filter the query, but in the interest of moving on with this page, it do.
Try below code , It may help to you.
I've created a custom post type for "portfolio" with a custom metabox with a lot of extra fields, one of which is a checkbox that I'm using to determine whether this post type contains a case study, but I've hit a snag and I can't see where I've gone wrong. The output for the checkbox is either 'yes' or ''.
The setup in my metabox build is:
And I can see the values exist as expected by outputting:
BUT, when I pull a basic WP query with args to filter those results:
I get nothing returned, even though doing the print_r shows me that the meta value does indeed exist and is equal to 'yes'. (if I comment out the meta_key/meta_value lines, all posts from the custom post type do display)
Anybody see something I don't here?
Add Comment