I’m trying to get wordpress posts belonging to a certain category if a condition is met.
So basically there is a select dropdown where the user chooses a category. Once they haven chosen said category I want to display the posts of that category, so something like:

<script>
var postID = "Case Study"  // category name

jQuery("#test").change(function(){
    if(jQuery(this).val()==postID){
         // get the posts of the category that is equal to Case Study
    }
});
</script>

I know how to do this if it was just one category i.e Case study, however as they have got the choice from several categories I need to somehow match the selected category and post only the posts from that category.

Any ideas?

Read more here: Get wordpress posts from certain category if statement


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: