pass dynamic value to page to pull in categorised post cards

There can be multiple ways to achieve this, but creating a new template for each taxonomy/category is surely not the best.

I will achieve this with a single template by using these two methods,

  1. You can pass the custom query variables while generating your dynamic pages or you can create a custom class that will loop through all categories, and adds additional variables as per the category. You can use is_tax() function with get_query_var() for this. Here you may be required to pass additional filter using add_filter( ‘query_vars’, ‘function_name’); depending upon your post query.

  2. Build a jQuery Ajax function and send your dynamically generated post loop results via wp_send_json().