Filter by data-meta_key not working (sometimes)
-
Hi,
I’m trying to use the plugin with buttons acting as filters to arrange the content in different orders depending on the button, each corresponding to a different meta field.
<li> <a id="preOwnedPrice" href="#" data-repeater="default" data-post-type="pre-owned-vehicles" data-taxonomy="pre-owned-vehicle-categories" data-taxonomy-terms="null" data-posts-per-page="10" data-scroll="true" data-button-label="Load More" data-orderby="meta_value_num" data-meta_key="Pre Owned Vehicle - Price">Price </a> </li> <li> <a id="preOwnedPrice" href="#" data-repeater="default" data-post-type="pre-owned-vehicles" data-taxonomy="pre-owned-vehicle-categories" data-taxonomy-terms="null" data-posts-per-page="10" data-scroll="true" data-button-label="Load More" data-orderby="meta_value_num" data-meta_key="Pre Owned Vehicle - Mileage">Mileage </a> </li>
When I do it like this for some reason it works for filtering by PRICE, but not by Mileage. The meta field itself in wordpress both hold number values.
When I use a shortcode to arrange by Mileage it does work.
echo do_shortcode('[ajax_load_more meta_compare="BETWEEN" posts_per_page="12" orderby="meta_value_num" meta_key="Pre Owned Vehicle - Mileage" post_type="pre-owned-vehicles" taxonomy="pre-owned-vehicle-categories" taxonomy_terms="" taxonomy_operator="" button_label="Load More"]');
However I want to bind it to a click. I don’t understand why it’s working for Price but not Mileage in the first instance. Everything is exactly the same.
I would appreciate any help.
Update:
You can see the page here: https://chevrolet.gmtemplate.co.za/pre-owned-vehicles/
Thanks,
Steven
- The topic ‘Filter by data-meta_key not working (sometimes)’ is closed to new replies.