Athlone
In den letzten 30 Tagen erstellte Support-Threads: 0
Lieblings-Forenthemen
This user has no favorite topics.
Forum Topics Created
Status | Thema | Supporter | Stimmen | Artikel | Aktualität |
---|---|---|---|---|---|
Toolset Galleries to work with Beaver Builder Galleries
Gestartet von: Athlone in: Toolset Professional Support |
3 | 6 | vor 4 Jahren | ||
Gallery Field
Gestartet von: Athlone
in: Toolset Professional Support
Problem: Solution: |
4 | 14 | vor 5 Jahren, 7 Monaten | ||
Display repeating list of pdf files with name (and downloadable link)
Gestartet von: Athlone
in: Toolset Professional Support
Problem: I have a repeating file field that holds PDF files. I would like to loop over the list of files and display an unordered list that shows the file name as a downloadable link. Solution: You can use the wpv-for-each shortcode to loop over each instance in a repeating field, but there's no built-in way to extract the file name from the custom field value. The custom field value will include the full URL of the file. You can add this custom shortcode to your child theme's functions.php file: add_shortcode( 'my_file_name', 'my_file_name_func'); function my_file_name_func($atts) { $urls = $atts['file_url']; $fileparts = explode('/', $urls); return end($fileparts); } Then in the wpv-for-each loop, you can use it like this to extract the file name and construct download links: <ul> [wpv-for-each field="wpcf-upload-file"] <li><a href="[types field='upload-file'][/types]">[my_file_name file_url="[types field='upload-file'][/types]"][/my_file_name]</a></li> [/wpv-for-each] </ul> Relevant Documentation: |
2 | 4 | vor 6 Jahren, 8 Monaten |