Hallo zusammen,
ich habe ein kleines Problem mit den "statischen Seiten" in WP.
Habe nun die Seiten "home" und "blog" angelegt.
Beide Seiten sind natürlich entsprechend als statische Seiten ausgewählt.
"home" nutzt das angelegte Template "home.php".
"blog" nutzt das Standard-Template.
Problem: "blog" zeigt den gleiche Inhalt wie "home",
dabei soll "blog" doch nur die letzten Artikel, also loop, anzeigen.
Habt Ihr eine Idee wie ich das wieder hin bekomme?
Hier mal der Inhalt von home.php:
im Grunde nur die Ausgabe der letzten 4 Artikel von Kategorien
PHP
<?php
/*
Template Name: Home
*/
get_header();
get_sidebar( 'left' );
if ( is_active_sidebar( 'secondary-widget-area' ) && is_active_sidebar( 'primary-widget-area' ) && is_active_sidebar( 'left-widget-area' )) {?>
<div id="container" class="three-sidebar">
<?php } elseif ( is_active_sidebar( 'primary-widget-area' ) && is_active_sidebar( 'left-widget-area' )) {?>
<div id="container" class="two-sidebar">
<?php } elseif ( is_active_sidebar( 'secondary-widget-area' ) && is_active_sidebar( 'primary-widget-area' )) {?>
<div id="container" class="two-sidebar">
<?php } else { ?>
<div id="container">
<?php } ?>
<div id="content" role="main">
<?php the_content(); ?>
<?php # start OWNED # ?>
<a href="/owned/" title="Lustige Videos"><h2>Owned</h2></a>
<?php query_posts('category_name=Owned&showposts=4');
if (have_posts()) : while (have_posts()) : the_post();
?>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>">
<ul>
<li>
<a class="widget-img-link" href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>">
<div class="runtime"><?php global $wp_query; $runtime = $wp_query->post->ID; echo get_post_meta($runtime, 'runtime', true); ?></div>
<?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) { the_post_thumbnail(array(70,100), array("class" => "widget-img")); } ?>
</a>
</li>
<li class="clear"><a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a></li>
<li><span><?php if(function_exists('the_views')) { the_views(); } ?> Aufrufe</span></li>
</ul>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
<?php # end OWNED # ?>
<?php # start FUNNY # ?>
<a href="/funny/" title="Lustige Videos"><h2>Funny</h2></a>
<?php query_posts('category_name=Funny&showposts=4');
if (have_posts()) : while (have_posts()) : the_post();
?>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>">
<ul>
<li>
<a class="widget-img-link" href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>">
<div class="runtime"><?php global $wp_query; $runtime = $wp_query->post->ID; echo get_post_meta($runtime, 'runtime', true); ?></div>
<?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) { the_post_thumbnail(array(70,100), array("class" => "widget-img")); } ?>
</a>
</li>
<li class="clear"><a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a></li>
<li><span><?php if(function_exists('the_views')) { the_views(); } ?> Aufrufe</span></li>
</ul>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
<?php # end FUNNY # ?>
<?php # start BABES # ?>
<a href="/babes/" title="Sexy Videos"><h2>Babes</h2></a>
<?php query_posts('category_name=Babes&showposts=4');
if (have_posts()) : while (have_posts()) : the_post();
?>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>">
<ul>
<li>
<a class="widget-img-link" href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>">
<div class="runtime"><?php global $wp_query; $runtime = $wp_query->post->ID; echo get_post_meta($runtime, 'runtime', true); ?></div>
<?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) { the_post_thumbnail(array(70,100), array("class" => "widget-img")); } ?>
</a>
</li>
<li class="clear"><a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a></li>
<li><span><?php if(function_exists('the_views')) { the_views(); } ?> Aufrufe</span></li>
</ul>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
<?php # end BABES # ?>
<?php # start OTHER # ?>
<a href="/other/" title="Andere Videos"><h2>Other</h2></a>
<?php query_posts('category_name=Other&showposts=4');
if (have_posts()) : while (have_posts()) : the_post();
?>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>">
<ul>
<li>
<a class="widget-img-link" href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>">
<div class="runtime"><?php global $wp_query; $runtime = $wp_query->post->ID; echo get_post_meta($runtime, 'runtime', true); ?></div>
<?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) { the_post_thumbnail(array(70,100), array("class" => "widget-img")); } ?>
</a>
</li>
<li class="clear"><a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a></li>
<li><span><?php if(function_exists('the_views')) { the_views(); } ?> Aufrufe</span></li>
</ul>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
<?php # end OTHER # ?>
</div><!-- #content -->
</div><!-- #container -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen