0

When on the my woocommerce shop page I can filter all the products by adding ?product_cat="painting" to the URL e.g. localhost.com/shop/?product_cat="painting".

Is there a similar there a similar way to do this for post_meta? I had a custom field called 'artists' and want to filter all the products which have the same artist ID!

Any help would be greatly appreciated!

  • If you use a taxonomy instead of a custom field then a query string such as ?artist=thomas would just work. – Andy Macaulay-Brook Sep 21 '16 at 16:35
  • Unfortunately all the data has already been entered so too late to create a taxonomy! – Thomas_Hoadley Sep 22 '16 at 12:02
  • I've resorted to testing to see if the artist filter is set in the url and then running a different loop depending on that! – Thomas_Hoadley Sep 22 '16 at 13:14
0

@Andy Macaulay-Brook is right.

You have to use a taxonomy and link to it just like you do with "painting"

  • How would the OP use this to address this particular question? – Andy Macaulay-Brook Sep 21 '16 at 16:33
  • I've edited my answer. It wasn't what he needs. – franfernandz Sep 21 '16 at 16:43
  • Unfortunately all the data has already been entered so too late to create a taxonomy! – Thomas_Hoadley Sep 22 '16 at 12:02
  • I've resorted to testing to see if the artist filter is set in the url and then running a different loop depending on that! – Thomas_Hoadley Sep 22 '16 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.