<?php
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID,
'exclude' => null
);
//obtenemos los adjuntos del articulo
$attachments = get_posts($args);
if ($attachments) { //si tiene los mostramos
foreach ($attachments as $attachment) {
echo apply_filters('the_title', $attachment->post_title);
the_attachment_link($attachment->ID, false);
}
}else{ //no tiene adjuntos
?>
<img src="images/no-pic.png" border="0" />
<?php
}
?> |
<?php
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID,
'exclude' => null
);
//obtenemos los adjuntos del articulo
$attachments = get_posts($args);
if ($attachments) { //si tiene los mostramos
foreach ($attachments as $attachment) {
echo apply_filters('the_title', $attachment->post_title);
the_attachment_link($attachment->ID, false);
}
}else{ //no tiene adjuntos
?>
<img src="images/no-pic.png" border="0" />
<?php
}
?>