我正在尝试将分页链接甚至下一页和上一页链接添加到 wordpress 上使用我不熟悉的自定义循环的静态主页。我的 php / wordpress 编解码器知识很少,不知道如何实现这一点。下面是循环的完整代码,任何帮助将不胜感激!
此外,这似乎是 211 wordpress 主题的子主题。
<?php
global $post;
//$args = array( 'numberposts' => 1, 'category' => 7 );
//$args=array( 'numberposts' => -1, 'category' => -6 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post);
//echo "<pre>";
//print_r($post);
?>
<div class="post_blog">
<h1><a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a></h1>
<div class="clr"> </div>
<?php //the_date();?>
<div class="post_cont">
<div class="post_thum"> <a href="<?php the_permalink() ?>">
<?php the_post_thumbnail();?>
</a> <span class="post_slogn"><?php echo $cfs->get('post_slogen'); ?></span>
</div>
<div class="post_right">
<p>
<?php //content(120);
content(100);
//the_content("Continue reading " . the_title('', '', false));
//content('<p style="text-align: justify;"><!--more--></p>');
?>
</p>
<div class="clr"> </div>
<span class="read_entry"><a href="<?php the_permalink() ?>">MORE <span>»</span></a> </span>
<div class="share"> <span class='st_facebook' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>'></span><span class='st_twitter' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>'></span><span class='st_linkedin' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>'></span><!-- <span class='st_email' st_title='<?php //the_title(); ?>' st_url='<?php //the_permalink(); ?>'> --></span><span class='st_plusone' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>'></span><span class='st_fblike' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>'></span></div>
</div>
<div class="clr"></div>
<div class="sub_title">
<?php //the_tags(' ');
the_tags('', ' ', ' ');
?>
</div>
</div>
</div>
<?php endforeach; ?>