Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/07/2013, 00:34
Avatar de madman_18
madman_18
 
Fecha de Ingreso: agosto-2010
Mensajes: 792
Antigüedad: 13 años, 8 meses
Puntos: 14
Respuesta: Mostrar el título de una imagen destacada

Cita:
Iniciado por ArturoGallegos Ver Mensaje
Buenos días!

Gracias por comentar! La verdad que funciona! Sobretodo el código este (por si alguien le sirve esto).
Código PHP:
Ver original
  1. $args = array( 'post_type' => 'attachment', 'orderby' => 'menu_order', 'order' => 'ASC', 'post_mime_type' => 'image' ,'post_status' => null, 'numberposts' => null, 'post_parent' => $post->ID );
  2.                                         $attachments = get_posts($args);
  3.                                         if ($attachments) {
  4.                                                 foreach ( $attachments as $attachment ) {
  5.                                                     $alt = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);
  6.                                                     $image_title = $attachment->post_title;
  7.                                                     $caption = $attachment->post_excerpt;
  8.                                                     $description = $image->post_content;
  9.                                                 }        
  10.                                         }
Sin embargo...podrías comentarme un poco cómo funciona el código? Soy novato en wordpress y no entiendo muy bien las funciones que usa, los argumentos...
__________________
"Si consigues ser algo más que un hombre, si te entregas a un ideal, te convertes en algo muy diferente"