Ich habe folgendes Problem. Ich habe eine Featured Sektion und dort werden automatisch 3 Beiträge einer Bestimmten Kategorie (Featured Post) ausgegeben.
Unterhalb läuft dann eine Ausgabe der restlichen Beiträge die nicht in dieser Kategorie sind.
Und genau da liegt das Problem: Der 4 Beitrag in der Kategorie Featured Post wird nicht mehr unten bei den restlichen Beiträge angezeigt, sondern verschwindet komplett. Erst wenn ich ihn von der der Kategorie Featured Post rausnehme, wird er mir unten angezeigt.
Ich habe schon einige Sachen versucht aber immer wieder führte es zu Problemen. Ich habe es zb schon geschafft das die 3 die oben angezeigt werden - auch unten angezeigt werden, also doppelt. Aber das ist nicht sehr fein.
Ich würde gerne also gern das der 4,5,6,7... in der Kategorie Featured Post automatisch bei den restlichen unten angezeigt wird.
Hier meine Dateien:
Versions.php (ließt die beiträge aus der kategorie aus)
<?php
$version = get_bloginfo('version');
if ($version > "2.3") {
$featuredcat = get_option('woo_featured_category'); // ID of the Featured Category
$ex_feat = $wpdb->get_var("SELECT term_id FROM $wpdb->terms WHERE name='$featuredcat' ORDER BY term_id DESC LIMIT 3");
$vidcat = get_option('woo_video_category'); // ID of the Video Category
$ex_vid = $wpdb->get_var("SELECT term_id FROM $wpdb->terms WHERE name='$vidcat'");
$asidecat = get_option('woo_asides_category'); // ID of the Asides Category
$ex_aside = $wpdb->get_var("SELECT term_id FROM $wpdb->terms WHERE name='$asidecat'");
$showposts = get_option('woo_other_entries'); // Number of other entries to be shown
} else {
$featuredcat = get_option('woo_featured_category'); // ID of the Featured Category
$ex_feat = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE cat_name='$featuredcat'");
$vidcat = get_option('woo_video_category'); // ID of the Video Category
$ex_vid = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE cat_name='$vidcat'");
$asidecat = get_option('woo_asides_category'); // ID of the Asides Category
$ex_aside = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE cat_name='$asidecat'");
$showposts = get_option('woo_other_entries'); // Number of other entries to be shown
}
$archives = get_option('woo_archives'); // Name of the archives page
$GLOBALS['archives_id'] = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '$archives'");
?>
Alles anzeigen
Featured.php (für ganz oben)
<?php
$showfeatured = get_option('woo_show_featured');
if ( $showfeatured ) {
?>
<?php
$showfeatured = get_option('woo_featured_entries'); // Number of other entries to be shown
include(TEMPLATEPATH . '/includes/version.php');
$the_query = new WP_Query('cat=' . $ex_feat . '&showposts=' . $showfeatured . '&orderby=post_date&order=desc');
$wp_query->in_the_loop = true; // Need this for tags to work
while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID;
?>
<div class="box">
<div class="featuredpost">
<?php if ( get_post_meta($post->ID,'image', true) ) { ?> <!-- DISPLAYS THE IMAGE URL SPECIFIED IN THE CUSTOM FIELD -->
<a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "image", $single = true); ?>&h=150&w=540&zc=1&q=95" alt="<?php the_title(); ?>" /></a>
<?php } ?>
<div class="date-comments">
<p class="fl"><?php the_time('j. F Y'); ?></p>
<p class="fr"><span class="comments"></span><?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></p>
</div>
<h2><a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<p class="content"><?php echo strip_tags(get_the_excerpt(), '<a><strong>'); ?></p>
<span class="continue"><a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>">Continue reading...</a></span>
</div><!--/featuredpost -->
</div><!--/box -->
<?php endwhile; ?>
<?php
}
?>
Alles anzeigen
Default.php (die restlichen beiträge werden unter der Featured.php angezeigt)
<?php
include(TEMPLATEPATH . '/includes/version.php');
$counter = 0; $counter2 = 0;
$the_query = new WP_Query('cat=-'. $ex_feat . ',-' . $ex_vid . ',-' . $ex_aside . '&showposts=' . $showposts . '&orderby=post_date&order=desc');
while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID;
?>
<?php $counter++; $counter2++; ?>
<div class="grid_5 <?php if ($counter == 1) { echo 'alpha'; } else { echo 'omega'; $counter = 0; } ?>">
<div class="box">
<div class="date-comments">
<p class="fl"><?php the_time('j. F Y'); ?></p>
<p class="fr"><span class="comments"></span><?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></p>
</div>
<h2><a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php if ( get_post_meta($post->ID,'image', true) ) { ?> <!-- DISPLAYS THE IMAGE URL SPECIFIED IN THE CUSTOM FIELD -->
<a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>"><img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "image", $single = true); ?>&h=75&w=75&zc=1&q=95" alt="<?php the_title(); ?>" class="fl" style="margin-top:5px;" /></a>
<?php } ?>
<p><?php echo strip_tags(get_the_excerpt(), '<a><strong>'); ?></p>
<span class="continue"><a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>">Continue reading...</a></span>
</div> <!-- end .box -->
</div> <!-- end .grid5 -->
<?php if ( !($counter2 == $showposts) && ($counter == 0) ) { ?> <div class="fix"></div> <?php } ?>
<?php endwhile; ?>
<div class="fix"></div>
<span class="fr continue-archives"><a href="<?php echo bloginfo('wpurl').'/?page_id='.$GLOBALS['archives_id']; ?>">See more articles in the archive</a></span>
Alles anzeigen
Ich wäre echt so froh, wenn mir da einer helfen könnte!!! DANKE!!