Hi, I have created a list of files to download and I want to show the weight of each file.
I have added a custom function in Toolset to manage a shortcode to display the data. The code is as follows:
/**
* New custom code snippet (replace this with snippet description).
*/
toolset_snippet_security_check() or die( 'Direct access is not allowed' );
add_shortcode('display-pdf-size', function($atts){
global $post;
$atts = shortcode_atts( array(
'pdf_url' =>'' ,
'meta_name' => 'size',
), $atts );
I have created a view of the download repeatable field to display the download file listing. In the link name it has file name and the shortcode to show the file weight.
Hello. Thank you for contacting the Toolset support.
I would like to know have you activated the code snipped you added? If yes:
Then I will require admin access details and problem URL where I can see the issue.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
As I suspected with my previous reply where I shared you should make sure that the code snippet should be active and when I logged in to the admin and when I checked the code snippet you added, it was not active.
I've activated the code snippet now.
Further - when I checked the problem URL you shared in the backend:
- hidden link
In backend:
- hidden link
I see there is no PDF uploaded to the repeating field group. Can you please first try to upload the PDF files to the repeating field group first and let me know after that if you able to see the file size or not.
Thanks Minesh, I checked to make sure it was active but I got confused. Thanks for your help. I have tried adding a PDF and its weight is displayed.
Please de URLs in private in the answers.
Thank you and have a nice day.