Если не работает пагинация WP_Query
Важно $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1;
1 2 3 4 5 6 7 8 9 10 |
$AQuery = new WP_Query( array( 'cat' => '7', 'paged' => $paged ) ); <? $ThisCatID = getCurrentCatID(); $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $AQuery = new WP_Query( array( 'cat' => $ThisCatID, 'paged' => $paged ) ); if (in_category( '7') ) { $AQuery = new WP_Query( array( 'cat' => '7', 'paged' => $paged ) ); } if ( $AQuery->have_posts()) : while ( $AQuery->have_posts()) : $AQuery->the_post(); ?> <? the_title(); ? <? $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' ); $url = $thumb['0']; if ( has_post_thumbnail() ) { ?> " > <? ;} ?> <? if (in_category( '21')) { echo ""; } ?> <? endwhile; endif; ?> |
Рассказать: