I have my solid PHP loop for dsiplaying attachments of a post:
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_parent' => get_the_ID(),
'post_mime_type' => array('application/pdf','application/msword','application/mspowerpoint','application/zip'),
);
$documenti = get_posts($args);
if($documenti) {
echo '<div class="gallery-documenti">';
echo '<ul class="post_attachments">';
foreach ($documenti as $documento) {
$class = "post-attachment mime-" . sanitize_title( $documento->post_mime_type );
$titolo_documento = wp_get_attachment_url( $documento->ID );
$nome_documento = $documento->post_title;
$nome_documento_corto = substr( $nome_documento, 0, 40) . '...';
$content .= '<li class="' . $class . '"><a href="' . $titolo_documento . '" target="_blank" class="att_icon" title="' . $nome_documento . '">' . $nome_documento . '</a></li>';
}echo $content;
echo '</ul>';
echo "<p class='clearfloat'></p>";
echo '</div>';
}
I just need to modify it to get the url of the files uploaded to “/wp-content/plugins/s2member-files”.. I’m just making some stupid mistake I think, any help?