Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/01/2012, 07:26
23xy
 
Fecha de Ingreso: febrero-2005
Mensajes: 78
Antigüedad: 19 años, 2 meses
Puntos: 0
Cómo hago para que se vean en la home una img de un post?

Hola a todos, cómo están?
Quisiera saber cómo puedo hacer para que en la index se cargue una img de la entrada, dejo el codigo:

El index llama a un archivo .php que es una porción de código, que es el siguiente:

Código PHP:
Ver original
  1. <div class="fcontent-top"></div>
  2. <div class="fcontent">
  3. <?php $featured_category1 = get_option('swt_featured_category1c'); $featured_number1 = '3'; ?>
  4. <?php if(($featured_category1 == "Choose a category:") || ($featured_number1 == '')) { ?>
  5. <?php { /* nothing */ } ?>
  6. <?php } else { ?>
  7. <h3> <?php echo $featured_category1; ?></h3>
  8. <?php
  9. //insert your category name
  10. $my_query = new WP_Query('category_name='. $featured_category1 . '&' . 'offset=' . '&' . 'showposts='. $featured_number1);
  11. while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; $the_post_ids = get_the_ID();
  12.         $c++; // increment the counter
  13.          if( $c % 3 != 0) {
  14.             $extra_class = 'novedades';
  15.            } else {
  16.            $extra_class = 'rightp'; }
  17. ?>
  18. <div class="fpostwrap <?php echo $extra_class; ?>">
  19. <div class="fpost-top"></div>
  20. <div class="fpost">
  21. <h4><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4>
  22. <?php get_the_image( array( 'custom_key' => array( 'fimage' ), 'default_size' => 'full', 'image_class' => 'aligncenter', 'width' => '190', 'height' => '112' ) ); ?>
  23. <p><?php truncate_post(250,true); ?></p>
  24. <a class="more2" href="<?php the_permalink() ?>#more">Lee más</a>
  25. </div><!-- FEAT CAT ENTRY END -->
  26. <div class="fpost-bot"></div>
  27. </div>
  28. <?php if(++$counter % 3 == 0) : ?>
  29. <?php endif; ?>
  30. <?php endwhile;?>
  31. <?php } ?>
  32. </div><!-- FEATURED CATEGORY END -->
  33. <div class="fcontent-bot"></div>

Espero me puedan ayudar.
Gracias.!!!!!!

Última edición por Nekko; 20/01/2012 a las 08:05