• i have this code which get me the file thumb (icon) and file link
    but i want to add file size to it

    $file = get_field('Book_Download');
    if( $file ):
    
        // Extract variables.
        $urle = $file['url'];
        $titlee = $file['title'];
        $captione = $file['caption'];
        $icone = $file['icon'];
    
    	
        // Display image thumbnail when possible.
        if( $file['type'] == 'pdf' ) {
            $icone =  $file['sizes']['thumbnail'];
        }
        // Begin caption wrap.
        if( $captione ): ?>
            <div class="wp-caption">
        <?php endif; ?>
        <a href="<?php echo esc_attr($urle); ?>" title="<?php echo esc_attr($titlee); ?>">
            <img src="<?php echo esc_attr($icone); ?>" />
            <span><?php echo esc_html($titlee); ?></span>
        </a>
    
        <?php 
        // End caption wrap.
        if($captione): ?>
            <p class="wp-caption-text"><?php echo esc_html($captione); ?></p>
            </div>
    
        <?php endif; ?>
    <?php endif; ?>

The topic ‘file size & File name’ is closed to new replies.