我正在开发自定义WordPress主题,因为我使用自定义查询来获取数据并使用分页来处理批量数据。 我已经编写了分页代码,它也在帖子下面显示分页。 我担心的是:每当我点击2页(分页)时,它就会显示第1页(分页)的相同帖子。
请查看以下代码供您参考: -
<div class="blog_area container">
<div class="wrapper row">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'video',
'order' => 'ASC',
'posts_per_page' => 1,
'paged' => $paged
);
$the_query = new WP_Query($args);
// The Query
while ($the_query->have_posts()):
$the_query->the_post();
$vdoLink = simple_fields_value('vdo_link');
$showVdo = $vdoLink;
?>
<div class="main_wrapper col-lg-12 col-md-12 row_wrapper">
<div class="col-md-6">
<div class='embed-container'>
<iframe src="<?php echo $showVdo;
?>" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div class="col-md-6">
<div class="row ">
<h2 class="margin-top-zero">
<b><?php the_title(); ?></b>
</h2>
</div>
<div class='row'>
<p><?php the_content('Read More');
?></p>
</div>
</div>
</div>
<?php
$post->ID;
endwhile;
$big = 999999999; // need an unlikely integer
?>
<div class="row">
<div class="pagination">
<?php
echo paginate_links(array(
// 'base' => str_replace( $big, '', esc_url( get_pagenum_link( $big ) ) ),
'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
'format' => '?paged=%#%',
'current' => max(1, get_query_var('paged')),
'total' => $the_query->max_num_pages
));
?>
</div>
</div
</div>
</div>
答案 0 :(得分:0)
你可以尝试这段代码。
WindowStyle = WindowStyle.None;
ResizeMode = ResizeMode.NoResize;
WindowState = WindowState.Maximized;
Topmost = true;