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
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.