Navigation überspringen

[Gelöst] I d'like to display an icon (or image) based on document file format pdf or xls

This support ticket is created vor 5 Jahren, 5 Monaten. 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/Karachi (GMT+05:00)

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Waqar vor 5 Jahren, 5 Monaten.

Assistiert von: Waqar.

Author
Artikel
#1403255

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="versteckter Link" width="24" height="29" class="alignleft size-medium" />

[wpv-post-title]

<br>

this is one of the output pages versteckter Link

many thanks in advance

#1404145

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