I have a custom post type where is a repeatable file field, if the file attached is a pdf in output view I d'like to show the pdf icon, when the file is a xlsx I' dl'ke to show the xlsx icon
I know the conditional output but I don't how to manage the file format
now i set the view like this and all works fine but obviously only the pdf icon are shown
<img src="hidden link" width="24" height="29" class="alignleft size-medium" />
[wpv-post-title]
<br>
this is one of the output pages hidden link
many thanks in advance
Hi,
Thank you for contacting us and I'd be happy to assist.
To use conditional output, based on the file's type/extension, you'll need a custom shortcode, that can return the file's extension ( i.e. pdf, xls etc ), from its URL.
This reply has a good example of such custom shortcode and its usage in the conditional output:
https://toolset.com/forums/topic/file-extension-in-conditional/#post-578332
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar