Skip Navigation

[Resolved] Filter WooCommerce gallery image by file extension

This thread is resolved. Here is a description of the problem and solution.

Problem:

I Would like to use the WooCommerce image shortcode and show only a result when the image has the file extension .png. Is this possible?

Solution:

There isn't such a built-in feature within Views plugin, you might consider custom codes.

Relevant Documentation:

https://codex.wordpress.org/Class_Reference/WP_Query

This support ticket is created 5 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by jelle-jacobd 5 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1188216

Tell us what you are trying to do?
I Would like to use the WooCommerce image shortcode and show only a result when the image has the file extension .png. Is this possible?

#1188719

Hello,

There isn't such a built-in feature within Views plugin, since Views is using WordPress class WP_Query to query posts, see document:
https://codex.wordpress.org/Class_Reference/WP_Query

There isn't such an option to filter the results by extension.

In your case, you might consider custom codes, you can also check it with our Toolset contractors:
https://toolset.com/contractors/

#1190992

My issue is resolved now. Thank you!