• Здравствуйте, у меня такая проблема:
    я создал шаблон для страницы и вывел нужные мне посты, но постраничная навигация не работает — http://waldub.ru/d/.
    Вот здесь я брал нужный материал:
    Как вывести отдельные посты на отдельную страницу.
    Несколько примеров использования query_posts()

    Вот код моего шаблона:

    <?php
    /*
    Template Name: fuuuuucccc
    */
    ?>
    <?php get_header(); ?>
    <div class="art-layout-wrapper">
        <div class="art-content-layout">
            <div class="art-content-layout-row">
                <div class="art-layout-cell art-sidebar1">
                  <?php get_sidebar('default'); ?>
                  <div class="cleared"></div>
                </div>
                <div class="art-layout-cell art-content">
    			<?php get_sidebar('top'); ?>
    			<?php
    				if(have_posts()) {
    
    					/* Display navigation to next/previous pages when applicable */
    					if ( theme_get_option('theme_' . (theme_is_home() ? 'home_' : '') . 'top_posts_navigation' ) ) {
    						theme_page_navigation();
    					}
    
    					/* Start the Loop */ 
    
                                            query_posts('cat=6'); global $more; $more = 0;
    					while (have_posts()) {
    						the_post();
    
    						get_template_part('content', get_post_format());
    					}
    
    					/* Display navigation to next/previous pages when applicable */
    					if (theme_get_option('theme_bottom_posts_navigation')) {
    						 theme_page_navigation();
    					}
    
    				} else {
    
    					 theme_404_content();
    
    				}
    		    ?>
    			<?php get_sidebar('bottom'); ?>
                  <div class="cleared"></div>
                </div>
                <div class="art-layout-cell art-sidebar2">
                  <?php get_sidebar('secondary'); ?>
                  <div class="cleared"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="cleared"></div>
    <?php get_footer(); ?>

    Помогите пожалуйста, сделать так, что бы постраничная навигация работала.

Просмотр 1 ответа (всего 1)
  • Теперь навигация работает, но не отмечается на какой странице находишься.

    Код шаблона:

    <?php
    /*
    Template Name: fuuuuucccc
    */
    ?>
    <?php get_header(); ?>
    <div class="art-layout-wrapper">
        <div class="art-content-layout">
            <div class="art-content-layout-row">
                <div class="art-layout-cell art-sidebar1">
                  <?php get_sidebar('default'); ?>
                  <div class="cleared"></div>
                </div>
                <div class="art-layout-cell art-content">
    			<?php get_sidebar('top'); ?>
    			<?php
    				if(have_posts()) {
    
    					/* Display navigation to next/previous pages when applicable */
    					if ( theme_get_option('theme_' . (theme_is_home() ? 'home_' : '') . 'top_posts_navigation' ) ) {
    						theme_page_navigation();
    					}
    
    					/* Start the Loop */
    $current_page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $numpost=10;//сколько записей на одной странице нам надо вывести
     if($paged>1) $offset=$numpost*($paged-1);
     else $offset=0;//чтобы знать, с какой статьи начать, если это не первая страница
    query_posts('cat=7&offset='.$offset.'&showposts='.$numpost); global $more; $more = 0; 
    
    					while (have_posts()) {
    						the_post();
    
    						get_template_part('content', get_post_format());
    					}
    
    					/* Display navigation to next/previous pages when applicable */
    					if (theme_get_option('theme_bottom_posts_navigation')) {
    						 theme_page_navigation();
    					}
    
    				} else {
    
    					 theme_404_content();
    
    				}
    		    ?>
    			<?php get_sidebar('bottom'); ?>
                  <div class="cleared"></div>
                </div>
                <div class="art-layout-cell art-sidebar2">
                  <?php get_sidebar('secondary'); ?>
                  <div class="cleared"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="cleared"></div>
    <?php get_footer(); ?>

Просмотр 1 ответа (всего 1)
  • Тема «Создал шаблон для страницы, не работает навигация.» закрыта для новых ответов.