Ich verwende ein template, in dem mit folgendem Code der Bildercode eingefügt wird:
PHP
<?php
$featuredcat = get_option('woo_featured_category'); // ID of the Featured Category
$the_query = new WP_Query('category_name=' . $featuredcat . '&showposts=5&orderby=post_date&order=desc');
$counter = 0;
while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID;
?>
<?php $counter++; ?>
<div class="featured" id="post-<?php the_ID(); ?>">
<?php if ( get_post_meta($post->ID, 'image', true) ) { ?> <!-- DISPLAYS THE IMAGE URL SPECIFIED IN THE CUSTOM FIELD -->
<div class="featured-img" style="background:url(<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "image", $single = true); ?>&h=226&w=300&zc=1&q=90) top left no-repeat;">
<div id="ribbon"><img src="<?php bloginfo('stylesheet_directory'); ?>/styles/<?php echo "$style_path"; ?>/ribbon.png" alt="Featured" /></div><!-- SHOW "FEATURED" RIBBON FOR FIRST POST ONLY -->
</div>
Alles anzeigen
Hierbei wird das Bild als Backgroundimage eingebaut, jedoch leider nicht das "normale Bild aus den Postings", sondern das, das in einem Zusatzfeld zum Posting angegeben werden muss.
Ich möchte aber gerne, dass einfach das erste ins Posting eingefügte (ist bei mir ohnehin immer nur eines) Bild da eingefügt wird.
Weiß jemand, wie man das dort aufruft ?