Hallo zusammen!
Ich habe eine knifflige Aufgabe und komme hier leider nicht weiter. Es geht um meine Website, http://www.timrodenbroeker.de
Ich möchte bestimmten Elementen in meinem Loop gerne über [COLOR=#0000BB][FONT=Consolas]<?php has_category[/FONT][/COLOR][COLOR=#007700][FONT=Consolas]( [/FONT][/COLOR][COLOR=#0000BB][FONT=Consolas]$category[/FONT][/COLOR][COLOR=#007700][FONT=Consolas], [/FONT][/COLOR][COLOR=#0000BB][FONT=Consolas]$post [/FONT][/COLOR][COLOR=#007700][FONT=Consolas]); [/FONT][/COLOR][COLOR=#0000BB][FONT=Consolas]?> eine extra CSS-Klasse hinzufügen, indem ich denen eine bestimmte Kategorie zuordne. Diese Elemente sollen nämlich einen Schlagschatten bekommen. Ich bin mit PHP leider nicht vertraut und hatte trotz einiger Versuche bisher keinen Erfolg.
Dies ist der Code aus der Datei loop.php
[/FONT][/COLOR]<?php if ( have_posts() ) : ?>
<div id="loop" class="<?php if ($_COOKIE['mode'] == 'list') echo 'list'; else echo 'list'; ?> clear">
<?php while ( have_posts() ) : the_post(); ?>
<div <?php post_class('post clear'); ?> id="post_<?php the_ID(); ?>">
<?php if ( has_post_thumbnail()) :?>
<?php if (in_category( "20" )): ?>
<span class="thumbstatic"> <?php the_post_thumbnail('thumbnail', array(
'alt' => trim(strip_tags( $post->post_title )),
'title' => trim(strip_tags( $post->post_title )),
)); ?></span>
<h2><?php the_title(); ?></h2>
<?php else: ?>
<a href="<?php the_permalink() ?>" class="thumb"><?php the_post_thumbnail('thumbnail', array(
'alt' => trim(strip_tags( $post->post_title )),
'title' => trim(strip_tags( $post->post_title )),
)); ?></a>
<h2><?php the_title(); ?></h2>
<?php endif; ?>
<?php endif; ?>
</div>
<?php endwhile; ?>
</div>
<?php endif; ?>
[COLOR=#0000BB][FONT=Consolas]
Ich möchte gerne, dass wenn der Artikel in der Kategorie mit der Nummer 21 ist, zusätzlich die Klasse "shadow" angewandt wird.
Ich hoffe man kann verstehen, was ich meine.
Danke euch!
Gr
[/FONT][/COLOR]