Ich denke ich hab hier was total falsch.
Ich habe in meiner Header Datei 3 Tabs eingebaut. Eine für neuste Artikel, einer für oben gehaltene artikel, und einer für die meist angesehenen Artikel.
Das ganze in Tabs weil es sonst viel zu unübersichtlich gewesen wäre. Ich hoffe das es trotzdem realisierbar ist.
Die Tabs sehen jetzt so aus (der erste Tab funktioniert)
<!--Tabs-->
<ul class="tabset_tabs">
<li><a href="#tab1" onclick="return false" class="active">Stickys</a></li>
<li><a href="#tab2" onclick="return false">newest posts</a></li>
<li><a href="#tab3" onclick="return false">Most viewed</a></li>
</ul>
<!--Tabs-->
<!--Tab1-->
<div id="tab1" class="tabset_content">
<h2 class="tabset_label">Newest stickys</h2>
<?php
function exclude_category($query) {
if ( $query->is_home() ) {
$query->set('cat', '-1');
}
return $query;
}
add_filter('pre_get_posts', 'exclude_category');
/* Get all Sticky Posts */
$sticky = get_option( 'sticky_posts' );
/* Sort Sticky Posts, newest at the top */
rsort( $sticky );
/* Get top 5 Sticky Posts */
$sticky = array_slice( $sticky, 0, 12 );
/* Query Sticky Posts */
query_posts( array( 'post__in' => $sticky, 'ignore_sticky_posts' => 1 ) );
?>
<ul><?php sort_query_posts_by('date', 'desc'); ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div class="uploads">
<a href="<?php the_permalink(); ?>">
<?php echo get_the_title(); ?>
<span><?php ciii_category_images(); ?>
</span>
<div class="uploadsviews">
<?php if(function_exists('the_views')) { the_views(); } ?></div>
<div class="uploadstime">
<?php the_time('j. F Y') ?>-
<?php the_time() ?></div>
</div>
</a> <?php endwhile; wp_reset_query(); // end of the loop. ?>
</ul></div>
<!--tab 2-->
<div id="tab2" class="tabset_content">
<h2 class="tabset_label">Newest</h2>
<ul>
<?php
query_posts(array(
"post__not_in" =>get_option("sticky_posts"),
"posts_per_page" => 20
)); ?>
s
<div class="uploads">
<a href="<?php the_permalink(); ?>">
<?php echo get_the_title(); ?>
<span><?php ciii_category_images(); ?>
</span>
<div class="uploadsviews">
<?php if(function_exists('the_views')) { the_views(); } ?></div>
<div class="uploadstime">
<?php the_time('j. F Y') ?>-
<?php the_time() ?></div>
</div>
</a> <?php wp_reset_query(); // end of the loop. ?>
</ul>
</div>
<div id="tab3" class="tabset_content">
<h2 class="tabset_label">Most Viewed</h2>
<ul>
<?php $most_viewed = new WP_Query('showposts=5&v_sortby=views&v_orderby=desc');
while ( $most_viewed->have_posts() ) : $most_viewed->the_post(); ?>
<div class="uploads">
<a href="<?php the_permalink(); ?>">
<?php echo get_the_title(); ?>
<span><?php ciii_category_images(); ?>
</span>
<div class="uploadsviews">
<?php if(function_exists('the_views')) { the_views(); } ?></div>
<div class="uploadstime">
<?php the_time('j. F Y') ?>-
<?php the_time() ?></div>
</div>
</a> <?php endwhile; wp_reset_query(); // end of the loop. ?>
</ul>
</div>
</div>
<!---Tabinhalt--->
Alles anzeigen
Dort ist auch der Code von meinem anderen Problem drin: http://forum.wpde.org/design/97869-k…html#post431247
Ich dachte ich teile es in zwei Themen auf sonst wird es zu unübersichtlich (was es jetzt auch ist)