I made a static html, css and javascript website. In subfolder of the site i installed wordpress and made a theme from a static html page which contains blog with news posts. Then i connected it with the rest of the website.
I would like to embend 3 latest wordpress posts on my static home page and add style to them.
I added this code to my static home index.php page
<?php
define('WP_USE_THEMES', false);
require('vesti/wp-blog-header.php');
?>
<?php
$number_of_posts = 3;
$args = array( 'numberposts' => $number_of_posts );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent_post ){
echo "<span>".$recent_post['post_date']."</span> <br>";
echo "<h3>".$recent_post['post_title']."</h3>";
echo "<p>".$recent_post['post_content']."</p><br><br>";
}
?>
Now i see my 3 latest posts with images and text but i dont know how to style them with CSS. I would like to add style to these posts - to paragraphs and images so i could set desired layout and appearance. And optionally , to shorten the text with "read more" option. Can anyone help me solve this problem?
?