Für eine Kategorie würde ich gerne die single.php ändern.
Habe es schon mit versucht
PHP
[COLOR=#000000] [COLOR=#0000BB]<?php
[/COLOR][COLOR=#007700]if ([/COLOR][COLOR=#0000BB]is_category[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]9[/COLOR][COLOR=#007700])) {
[/COLOR][COLOR=#FF8000]// looking for category 9 posts
[/COLOR][COLOR=#007700]include([/COLOR][COLOR=#0000BB]TEMPLATEPATH [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#DD0000]'/single2.php'[/COLOR][COLOR=#007700]);
} else {
[/COLOR][COLOR=#FF8000]// put this on every other category post
[/COLOR][COLOR=#007700]include([/COLOR][COLOR=#0000BB]TEMPLATEPATH [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#DD0000]'/single1.php'[/COLOR][COLOR=#007700]);
}
[/COLOR][COLOR=#0000BB]?>[/COLOR] [/COLOR]
leider erfolglos
das ging auch nicht:
PHP
<?php $post = $wp_query->post;
if ( in_category('1') ) {
get_template_part('singlekat','kategorie1');
} elseif ( in_category('2') ) {
get_template_part('singlekat','kategorie2');
} else {
…
}
?>
Mein Loop sieht so aus:
PHP
<?php while ( have_posts() ) : the_post(); ?>
<!-- <?php
if ( has_post_thumbnail() ) {
the_post_thumbnail();
}
?>-->
<?php get_template_part( 'content', 'single' ); ?>
<?php get_template_part( 'navigation', 'single' ); ?>
<?php
do_action( 'ample_before_comments_template' );
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() )
comments_template();
do_action ( 'ample_after_comments_template' );
?>
<?php endwhile; ?>
Alles anzeigen
Danke vorweg für alle Tipps