-1
我用這個查詢與WordPress,讓我的文章類型分頁的WordPress:自定義分頁查詢
<?php
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'paged' => $paged,
'author' => $user_id
);
$my_query = new WP_Query($args);
if($my_query->have_posts()):
while($my_query->have_posts()):$my_query->the_post();
?>
<article class="listaNoticia column large-6 medium-6 small-12">
<a href="<?php the_permalink(); ?>">
<p class="data"><?php the_time('d/m/Y'); ?></p> <br><br>
<h2><?php the_title(); ?></h2>
</a>
</article>
<!-- END ITEM -->
<?php endwhile; endif; ?>
<div class="paginacao column large-12 medium-12 snall-12">
<div>
<?php wp_pagenavi(); ?>
<?php if(function_exists('wp_paginate')) { wp_paginate(); } ?>
</div>
</div>
我用這個查詢,但現在它的加載所有的職位和無分頁。
有人得到這個問題?
謝謝!