get_header(); $wpdc_docs = array('post_type' => 'documentos', 'posts_per_page' => '-1'); $docs = new WP_Query($wpdc_docs); ?> <!-- flexboxer --> <div id="flexboxer-<?php the_ID(); ?> " class="flexboxer flexboxer--docs"> <section id="doclist" class="wrap wrap--content wrap--shadow wrap--doclist"> <h3 class="title title--section">Documentos</h3> <?php if ($docs->have_post()) { ?> <h3 class="sep">Listado de documentos</h3> <ul class="list"> <?php while ($docs->have_posts()) { $docs->the_post(); $postmeta = get_post_meta($post->ID); $old_files = $postmeta['wpcf-docfile'][0]; $media = get_attached_media('application', $post->ID); ?> <li class="item wrap wrap--flex"> <div class="wrap wrap--frame wrap--frame__middle"> <?php if ($old_files != '') { ?>