• Люди добрые, помгоите ламеру советом…

    ЗАДАЧА: Шаблон (заточенный под видео) выводит за раз только один пост — на главной и даже в архиве. Как сделать так, чтобы посты выводились как обычно, по многу?

    Содержание index.php:

    <?php get_header(); ?>
        <?php
            if (get_option('woo_home'))
        include (TEMPLATEPATH . '/layout-home.php');
           else
        include (TEMPLATEPATH . '/layout-single.php');
        ?>
    <?php get_footer(); ?>

    А вот содержание layout-home.php, к которому он отсылает:

    <!-- Content Starts -->
    <div id="content" class="wrap">
    <div class="col-left home">
    <?php if (is_paged()) $is_paged = true; ?>
    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("paged=$paged"); ?>
    <?php if (have_posts()) : $count = 0; $boxcount = 0;?>
    <?php while (have_posts()) : the_post(); $count++; ?>
    <?php if ($count == 1 && get_option('woo_home_featured') && !$is_paged) : ?>
    <?php woo_get_custom('embed'); ?>
    <!-- Post Starts -->
    <div class="post wrap">
    <?php echo get_avatar( get_the_author_id(), '37' ); ?>
    <div class="fl">
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <p class="post-details"><?php the_time('d M Y'); ?> <?php the_author_posts_link(); ?> <?php the_category(', ') ?></p>
    </div>
    <div class="comment-cloud fr">
    <a href="<?php comments_link(); ?>"><?php comments_number('0','1','%'); ?></a>
    </div>
    <?php if(function_exists('the_ratings')) { echo '<div class="fr ratings">'; the_ratings(); echo '</div>'; } ?>
    <div class="fix"></div>
    <?php if (get_option('woo_home_content')) the_content(); ?>
    </div>
    <!-- Post Ends -->
    <?php if (!get_option('woo_ad_content_disable')) { ?>
    <?php include (TEMPLATEPATH . "/ads/content_ad.php"); $ad_shown = true; ?>
    <?php }    ?>
    <!-- main-content ends -->
    <!-- main ends -->
    <?php continue; endif; ?>
    <div class="video-box <?php $boxcount++; if ($boxcount == 3) { echo 'last'; } ?> ">
    <div class="inside">
    <?php woo_get_image('image','','190','142'); ?>
    <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4>
    </div>
    <div class="box-bot">
    <?php if(function_exists('the_ratings')) { echo '<div class="fl ratings">'; the_ratings(); echo '</div>'; } ?>
    <div class="comment-cloud fr">
    <a href="<?php comments_link(); ?>"><?php comments_number('0','1','%'); ?></a>
    </div>
    </div>
    </div>
    <?php if ($boxcount == 3) { $boxcount = 0; echo '<div class="fix"></div>'; } ?>
    <?php endwhile; else: ?>
    <p>Sorry, no posts matched your criteria.</p>
    <?php endif; ?>
    <div class="more_entries wrap">
    <?php if (function_exists('wp_pagenavi')) { ?><?php wp_pagenavi(); ?><?php } ?>
    </div>
    </div>
    <!-- .col-left ends -->
    <div class="col-right">
    <?php get_sidebar(); ?>
    </div>
    </div>
    <!-- Content Ends -->

    И layout-single.php:

    <!-- Content Starts -->
    <div id="content" class="wrap">
    <div id="main" class="col-left">
    <?php query_posts("&showposts=1"); ?>
    <?php if (have_posts()) : $count = 0; ?>
    <?php while (have_posts()) : the_post(); $postcount++;?>
    <div id="main-content">
    <?php woo_get_custom('embed'); ?>
    <!-- Post Starts -->
    <div class="post wrap">
    <?php echo get_avatar( get_the_author_id(), '37' ); ?>
    <div class="fl">
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <p class="post-details"> <?php the_time('d M Y'); ?> <?php the_author_posts_link(); ?> <?php the_category(', ') ?></p>
    </div>
    <?php if(function_exists('the_ratings')) { echo '<div class="fr ratings">'; the_ratings(); echo '</div>'; } ?>
    <div class="fix"></div>
    <?php the_content(); ?>
    <?php the_tags('<p class="tags">', ', ', '</p>'); ?>
    <!-- Content Ad Starts -->
    <?php if (!get_option('woo_ad_content_disable') && !$is_paged && !$ad_shown) { include (TEMPLATEPATH . "/ads/content_ad.php"); $ad_shown = true; } ?>
    <!-- Content Ad Ends -->
    </div>
    <!-- Post Ends -->
    </div>
    <!-- main-content ends -->
    <!-- show embed code -->
    <?php include(TEMPLATEPATH . "/includes/embed.php"); ?>
    <div id="comments">
    <?php $withcomments = 1; comments_template(); ?>
    </div>
    <?php endwhile; else: ?>
    <p>Sorry, no posts matched your criteria.</p>
    <?php endif; ?>
    </div>
    <!-- main ends -->
    <div class="col-right">
    <?php get_sidebar(); ?>
    </div>
    </div>
    <!-- Content Ends -->
Просмотр 1 ответа (всего 1)
Просмотр 1 ответа (всего 1)
  • Тема «Вывод постов на главной» закрыта для новых ответов.