I have created a static web page to serve as my primary homepage. The page is built using HTML and CSS, with some PHP code pulled from My WordPress integrated into it. One of the functionalities I've added is to display the three most recent posts on the page. While the PHP code successfully fetches and displays these posts, I'm facing an issue in customizing their appearance using CSS. Below is the snippet of PHP code responsible for displaying the latest posts:
<?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>
Despite numerous attempts using CSS to target elements like div
, span
, and even the ul
itself, I haven't been able to modify the styling of the displayed posts. No matter what I try, the appearance remains unchanged.