
Custom Field Images
Sólo necesitamos crear una función:
-
<?php
-
function catch_that_image() {
-
$first_img = '';
-
$first_img = $matches [1] [0];
-
// si no se encuentra, usamos una imagen por defecto
-
$first_img = "/images/default.jpg";
-
}
-
return $first_img;
-
}
-
?>
-
<img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>"/>
-
<?php if (have_posts()) : ?>
-
<?php query_posts('showposts=10'); ?>
-
<?php while (have_posts()) : the_post(); ?>
-
<div class="miniatura">
-
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
-
<img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>"/>
-
</a>
-
</div>
-
<?php endwhile;?>
-
<?php else : ?>
-
<?php include(TEMPLATEPATH . "/404.php"); ?>
-
<?php endif; ?>





Vaya, desde Reader no se ve el cambio que diste a la plantilla, mucho más clarito y diáfano.
Agosto 2nd, 2009 |Es extraño que escojas el blanco como fondo ¿estás bien?
Lo siento si no va con la entrada pero cuando leo algo de php es como si estuviera leyendo las instrucciones de la impresora.