Louis Nel
Forum Replies Created
-
AuthorPosts
-
Dear Paolo
You are saving me a lot of trouble.
Thank you very much.
May 19, 2017 at 6:10 am in reply to: Rename file upload link to include part of the filename, before the extension? #379057Dear Stiofan
Thank you for your help. Currently the answer you gave is the option most people would use, but then you still have people giving files unsexy names, and the “pdf” bit at the end does not make it better.
I have the situation where people have up to four menus. I would have to create upload fields that would say “Download Menu no.1”, “Download menu no.2” because there are just so many types of menus.
In the attachment four menus are displayed in their own tab on a unrelated directory website, within a tab. The tabs have the menu’s unique name on them. These are html fields which would be fine. Currently I can create html fields, that can be in their own tabs, but they would still have to have generic names on the tabs.
The suggestion for multiple file uploads here ( https://wpgeodirectory.com/support/topic/multiple-files-into-the-same-custom-field/ ) is a possibility with some work.
Thank you for your help.
May 17, 2017 at 5:53 am in reply to: Rename file upload link to include part of the filename, before the extension? #378713Hi
Thank you for getting back to me so quickly.
At the moment when I upload a file called Summer_Menu.pdf under the “File Upload” field, it will display a link called Summer_Menu.pdf . That is ok, but if the file is called 345_Sum20170517.pdf it is a bit messy. Putting the code below into the functions.php , I can get it to display that particular field with html variable “winter_menu”, as “Download the Winter Menu”
// Replace ‘winter_menu’ in “geodir_show_geodir_winter_menu” with the html variable of your custom field
add_filter(“geodir_show_geodir_winter_menu”,”myTheme_change_menu_title”, 10,2);
function myTheme_change_menu_title($html, $variables_array){
if($parts = explode(‘target=”_blank”>’,$html)){
$html = $parts[0].’target=”_blank”>Download the Winter Menu</div></div>’;
}
return $html;
}Because there are so many types of menus, I cannot create a field for each one, because everybody in the restaurant business has their own menu type. I would like to get the link name to be derived from the pdf file name. That means the pdf file name will have to be properly formatted, but that will just have to be the case.
If the file is called Bar_Mitzvah.pdf I want the link to be displayed as “Download the Bar Mitzvah Menu”. If the file is called Breakfast.pdf I want the link to be displayed as “Download the Breakfast Menu”.
Is there a way this can be done?
Kind regards
Hi
Thank you very much, that was exactly the problem.
Thank you very very much.
This reply has been marked as private.This reply has been marked as private. -
AuthorPosts