我有一个静态网页,我用它作为我的主要主页。我正在设计与HTML和CSS代码与一些PHP代码从我的WordPress集成的页面。最后一个集成代码是显示最近3个帖子的代码。它显示了帖子,但我不能用CSS修改结果。下面是PHP代码:
<?php
$args=array('numberposts'=>3,'post_status'=>"publish",'post_type'=>"post",'orderby'=>"post_date");
$postslist = get_posts( $args );
echo '<ul class="latest_posts">';
foreach ($postslist as $post) : setup_postdata($post);
?>
<li>
<?php the_post_thumbnail('medium'); ?><br/>
<a href="<?php the_permalink(); ?>" title="<?php the_title();?>"> <?php the_title(); ?></a>
</li>
<?php endforeach; ?>
</ul>
我在CSS中尝试了一切,命名div
,命名span
,甚至在CSS中使用ul
,什么都没有发生。
important
将不需要如果你的css规则编码正确。最后的规则应该覆盖之前的规则。确保你的目标是正确的元素,并把你想要应用的规则放在css代码的最后。
在你的自定义CSS文件中使用
ul.latest_posts{
list-style: none !important;
}