为什么无论您在站点中的哪个页面上,以下代码都会导致我的面包屑跟踪在面包屑中显示相同的帖子链接?
我已经被这个问题困扰了很久,只是无法弄清楚......
看看我在这里的意思。
<!-- Loops through Stories and returns images -->
<ul style="width: 1520px">
<?php
global $post;
$category_id = get_cat_ID('stories');
$args = array( 'numberposts' => 9, 'offset'=> 0, 'category'=> $category_id );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<!-- stories -->
<li>
<figure>
<?php if ( has_post_thumbnail()) : // Check if thumbnail exists ?>
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(array(64,64)); // Declare pixel size you need inside the array ?></a>
<?php endif; ?>
</figure>
<!-- /post thumbnail -->
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
</li>
<?php endforeach; ?>
</ul>
<!-- /Loops through Stories and returns images -->