WordPress 페이지 매김을 얻으려고합니다.WordPress 페이지 매기기가 작동하지 않음 Page 2
다른 플러그인을 사용하고 pagination.php 함수의 코드를 아무런 변화없이 시도해 보았습니다.
내가 지금까지 사용해 왔던 플러그인이나 조정과 상관없이 페이지 2, 3 등은 항상 동일한 게시물 집합을 표시합니다. 내가 파일 중 하나에서 변경해야합니까
<!-- THE POST QUERY -->
<?php
wp_reset_query();
global $paged;
global $template_file;
$cat_string = '';
$format = '';
if(get_post_custom_values('blog_post_count')) :
$post_array = get_post_custom_values('blog_post_count');
$post_count = join(',', $post_array);
else :
$post_count = -1;
endif;
/* Get Category Filter */
if(get_custom_field('blog_category_filter')) :
$cats = get_custom_field('blog_category_filter');
foreach ($cats as $cat) {
$acats[] = $cat;
}
$cat_string = join(',', $acats);
endif;
$args=array(
'cat'=>$cat_string, // Query for the cat ID's (because you can't use multiple names or slugs... crazy WP!)
'posts_per_page'=>$post_count, // Set a posts per page limit
'paged'=>$paged, // Basic pagination stuff.
);
query_posts($args); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php get_template_part('includes/format', $format); ?>
<?php endwhile; else: ?>
<div class="post">
<p><?php _e('Sorry, no posts matched your criteria.', 'skeleton') ?></p>
</div><!-- /.post -->
<?php endif; ?>
<?php get_template_part('includes/element', 'pagination'); ?>
<?php wp_reset_query(); ?>
</div>
그것을 얻을 : 여기
는 홈 페이지에 대한 블로그 템플릿의 코드 pagination.php 여기<!-- Previous/More Entries -->
<div class="mdnw_pagination">
<?php if(function_exists('wp_paginate')) :
wp_paginate();
; else : ?>
<div class="p button"><?php next_posts_link(__('« Previous Posts', 'skeleton')); ?></div>
<div class="m button"><?php previous_posts_link(__('Next Posts »', 'skeleton')); ?></div>
<?php endif; ?>
</div>
<!-- </Previous/More Entries -->
의 코드입니다 첫 번째 페이지가 아닌 다른 내용을 표시 하시겠습니까?
독서 창 설정을 변경 하겠지만 쿼리 게시 기능은 내가 모르는 동적 값을 사용합니다.
어떻게 작동 시키려면 변경해야합니까?
나는이 페이지 https://wordpress.stackexchange.com/questions/105977/wordpress-pagination-not-working-always-showing-first-pages-content의 솔루션을 시도했지만 아무 소용이 :<?php
wp_reset_query();
global $paged;
global $template_file;
$cat_string = '';
$format = '';
if(get_post_custom_values('blog_post_count')) :
$post_array = get_post_custom_values('blog_post_count');
$post_count = join(',', $post_array);
else :
$post_count = -1;
endif;
/* Get Category Filter */
if(get_custom_field('blog_category_filter')) :
$cats = get_custom_field('blog_category_filter');
foreach ($cats as $cat) {
$acats[] = $cat;
}
$cat_string = join(',', $acats);
endif;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args=array(
'cat'=>$cat_string, // Query for the cat ID's (because you can't use multiple names or slugs... crazy WP!)
'posts_per_page'=> 9, // Set a posts per page limit
'paged'=>$paged, // Basic pagination stuff.
);
$your_query = new WP_Query($args); ?>
<?php if ($your_query->have_posts()) : while ($your_query->have_posts()) : $your_query->the_post(); ?>
<?php get_template_part('includes/format', $format); ?>
<?php endwhile; else: ?>
<div class="post">
<p><?php _e('Sorry, no posts matched your criteria.', 'skeleton') ?></p>
</div><!-- /.post -->
<?php endif; ?>
<?php get_template_part('includes/element', 'pagination'); ?>
<?php wp_reset_query(); ?>