我在我的网站上使用Genesis框架,并在我的函数中添加了以下代码。php自定义归档循环。
//* Archive Custom Loop
function archive_custom_loop() {
echo \'<div class="archive-pagination">\';
next_posts_link(\'<div class="proigoumeno">Previous Posts »</div>\', $loop ->max_num_pages);
previous_posts_link(\'<div class="epomeno">« Newer Posts</div>\', $loop ->max_num_pages);
echo \'</div>\';
while (have_posts()) : the_post();
?>
<div class="lista"><a href="<?php the_permalink() ?>" target="_blank" style="font-weight: 700;"><?php the_title() ?></a><br><p class="entry-meta"><span class="entry-author"><?php the_author_posts_link(); ?></span><span class="provoles"><?php do_action( \'pageviews\' ); ?> <img src="https://www.pcsteps.com/wp-content/uploads/2017/05/views.png" alt="Views"></span><span class="imerominia">Posted: <?php the_date() ?></span></p></div>
<div class="eikona"><a href="<?php the_permalink() ?>" target="_blank"><?php the_post_thumbnail( array(360, 200) ); ?></a></div>
<div class="perilipsi"><?php $content = get_the_excerpt(); echo mb_strimwidth($content, 0, 500, \'...\'); ?></div>
<div class="diaxwristiko"></div>
<?php
endwhile;
echo \'<div class="archive-pagination">\';
next_posts_link(\'<div class="proigoumeno">Previous Posts »</div>\', $loop ->max_num_pages);
previous_posts_link(\'<div class="epomeno">« Newer Posts</div>\', $loop ->max_num_pages);
echo \'</div">\';
}
我想要的是选择一个作者ID,并将其从存档中完全排除。
我读过the codex for the loop, 但是语法有点不同,我不知道如何实现它。