Hallo,
ich suche nach einer Möglichkeit auf der WP Startseite (im Theme index.php) den neusten Artikel der Newskategorie an zu zeigen (mit Thumbnail). Den Code zum Anzeigen habe ich ( http://codex.wordpress.org/Function_Refer…_post_thumbnail ), nur wie bekomme ich an die notwendige POST ID
PHP
<?php
global $post;
$tmp_post = $post;
$args = array( 'numberposts' => 1, 'category' => 1 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; $post = $tmp_post; ?>