Hallo Leute,
ich habe folgendes Problem. Auf meiner Homepage feature ich drei Posts einer bestimmten Kategorie. Momentan ist der Code darauf ausgerichtet, dass immer die drei letzten Posts dieser Kategorie gefeatured werden. Ich würde jedoch gerne drei bestimmte anzeigen lassen indem ich die entsprechende ID eingebe. Leider weiss ich nicht, was ich an dem php code verändern muss, damit das auch klappt. Hab mittlerweile alles versucht, bekomme aber nur Fehlermeldungen. Hier ist der Code:
PHP
<?php $recent = new WP_Query("cat=166&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>
<?php else: ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a>
<?php endif; ?>
<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
<?php the_content_limit(80, ""); ?>
<div style="border-bottom:1px dotted #94B1DF; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div>
<?php endwhile; ?>
Alles anzeigen
Wäre echt super dankbar, wenn mir jemand dabei helfen könnte.
Gruß,
dk