I was so curious in creating themes for WordPress and thought to create one for myself (finally)
Seems like as much as I try, I can't get the website to display my recent posts -> 2 lines | 2 posts
Here is the PHP I'm using
<div id="blogg" class="row">
<div class="container">
<div id="blogg_innlegg_left"><div class="well">
<ul>
<?php $left_query = new WP_Query( 'showposts=2' ); ?>
<?php while ($left_query -> have_posts()) : $left_query -> the_post(); ?>
<div class="thumb">
<li><a href="<?php the_permalink() ?>"><?php the_post_thumbnail(); ?></a></li>
</div>
<div class="title">
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
</div>
<?php endwhile;?>
</ul>
</div></div>
<div id="blogg_innlegg_right"><div class="well">
<ul>
<?php $right_query = new WP_Query( 'showposts=5&offset=2' ); ?>
<?php while ($right_query -> have_posts()) : $right_query -> the_post(); ?>
<div class="thumb">
<li><a href="<?php the_permalink() ?>"><?php the_post_thumbnail(); ?></a></li>
</div>
<div class="title">
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
</div>
<?php endwhile;?>
</ul>
</div></div>
</div>
</div>
Here is the CSS I'm using
#blogg_innlegg_left, #blogg_innlegg_right {
display: flex;
.well{
width: 100%;
ul {
columns: 2;
-webkit-columns: 2;
-moz-columns: 2;
list-style: none;
}
.thumb {
float: left;
}
.title {
float: left;
max-width:100px;
}
}
}
Every time I try to align them, it goes wrong, even the mobile responsive.
I want to achieve the exact match as in wpbeginner.com with the recent posts on the homepage.