我用过single.php
对于此代码:
<?php $categories = get_the_category($post->ID);
if ($categories) {
$category_ids = array();
foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
$args=array(
\'category__in\' => $category_ids,
\'post__not_in\' => array($post->ID),
\'showposts\'=>6, //Gösterilecek yazı adeti
\'caller_get_posts\'=>1
);
$benzer = new wp_query($args);
if( $benzer->have_posts() ) {
while ($benzer->have_posts()) {
$benzer->the_post();
?>
<div class="urundetaykutu">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</div>
<?php } } wp_reset_query(); }?>
这段代码正常工作,但我想在循环中使用分页。