So ich habe es hinbekommen.
PHP
<?php query_posts( 'cat=7,10' ); ?>
<!-- Start the Loop. -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- Test if the current post is in category 7. -->
<!-- If it is, the div box is given the CSS class "news-item". -->
<!-- Otherwise, the div box is given the CSS class "portfolio-item". -->
<?php if ( in_category('7') ) { ?>
<div class="news-item">
<h3><strong><?php$posttags = get_the_tags();if ($posttags) {foreach($posttags as $tag) {echo $tag->name . ' '; } } ?></strong> - <?php $suchwort = get_post_custom_values('Kunde-Service'); ?><?php if(!(empty($suchwort))) { ?><?php echo $suchwort[0]; ?><?php } ?><br /><?php the_title(); ?>
</h3>
<div class="entry">
<?php the_content(); ?>
</div>
</div>
<?php } else { ?>
<div class="portfolio-item">
<?php if ( function_exists( 'get_the_image' ) ) get_the_image(); ?>
</div>
<?php } ?>
<!-- Stop The Loop (but note the "else:" - see next line). -->
<?php endwhile; else: ?>
<!-- The very first "if" tested to see if there were any Posts to -->
<!-- display. This "else" part tells what do if there weren't any. -->
<p>Sorry, no posts matched your criteria.</p>
<!-- REALLY stop The Loop. -->
<?php endif; ?>
Alles anzeigen