Can you help me to find the right code for pagination with this loop?
Here is my loop:
<?php query_posts('showposts=1&post_type=post'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
...
<?php endwhile; else: ?>
...
<?php endif; ?>
<?php rewind_posts(); ?>
<?php query_posts('showposts=2&offset=1&post_type=post'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
...
<?php endwhile; else: ?>
...
<?php endif; ?>
<?php rewind_posts(); ?>
<?php query_posts('showposts=6&offset=3&post_type=post'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
...
<?php endwhile; else: ?>
...
<?php endif; ?>
EDIT
This was my old loop, how can I convert it to the new one? Unfortunately I don't know how php works..
<?php
if (is_front_page() ) {
get_header( 'front' );
} else {
get_header();
}
?>
<section id="content" class="container">
<div class="row">
<div class="col-md-7 col-sm-7">
<?php query_posts('showposts=1&post_type=post'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article class="thumbnail thumbnail-principale expand-image">
<div class="featured-image">
<?php echo get_the_post_thumbnail($post_id, 'large', array('class' => 'img-responsive')); ?>
</div>
<div class="destacado"><h3>Destacado</h3></div>
<header class="testo-articolo">
<h3><?php the_title(); ?></h3>
<div class="entry-meta">
<p class="text-muted resume"><span><i class="fa fa-calendar"></i><?php the_time('j M y'); ?></span><span><i class="glyphicon glyphicon-user"></i><?php the_author(); ?></span><span><i class="fa fa-comment-o"></i><?php comments_popup_link('0', '1 Comentario', '% Comentarios'); ?></span></p>
</div>
<p><?php the_excerpt(); ?></p>
<?php comments_template(); ?><!-- da sistemare -->
</header>
</article>
</div>
<?php endwhile; else: ?>
<p>Sorry, there are no posts to display</p>
<?php endif; ?>
<?php rewind_posts(); ?>
<?php query_posts('showposts=2&offset=1&post_type=post'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="col-md-5 col-sm-5">
<article class="thumbnail thumbnail-destra expand-image">
<div class="featured-image">
<?php echo get_the_post_thumbnail($post_id, 'large', array('class' => 'img-responsive')); ?>
</div>
<header class="testo-articolo-destra expand-image">
<h3><?php the_title(); ?></h3>
<div class="entry-meta">
<p class="text-muted resume"><span><i class="fa fa-calendar"></i><?php the_time('j M y'); ?></span><span><i class="glyphicon glyphicon-user"></i><?php the_author(); ?></span><span><i class="fa fa-comment-o"></i><?php comments_popup_link('0', '1 Comentario', '% Comentarios'); ?></span></p>
</div>
<p><?php the_excerpt(); ?></p>
</header>
<div class="badge1"></div>
</article>
</div>
<?php endwhile; else: ?>
<p>Sorry, there are no posts to display</p>
<?php endif; ?>
</div><!-- /.row -->
<div class="row">
<?php rewind_posts(); ?>
<?php query_posts('showposts=6&offset=3&post_type=post'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="col-md-4 col-sm-4">
<article class="thumbnail distanza expand-image">
<div class="featured-image">
<?php echo get_the_post_thumbnail($post_id, 'large', array('class' => 'img-responsive ingrandire-img')); ?>
</div>
<header class="testo-articolo">
<h3><?php the_title(); ?></h3>
<div class="entry-meta">
<p class="text-muted resume"><span><i class="fa fa-calendar"></i><?php the_time('j M y'); ?></span><span><i class="glyphicon glyphicon-user"></i><?php the_author(); ?></span><span><i class="fa fa-comment-o"></i><?php comments_popup_link('Ningún comentario', '1 Comentario', '% Comentarios'); ?></span></p>
</div>
<p><?php the_excerpt(); ?></p>
<p><a class="btn btn-default read-more" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php _e( 'Lee más', 'katartika' ); ?></a></p>
</header>
</article>
</div>
<?php endwhile; else: ?>
<p>Sorry, there are no posts to display</p>
<?php endif; ?>
</div><!-- /row -->
<div style="text-align:center;">
<?php posts_nav_link(‘|’, ‘Prossimo’, ‘Precedente’); ?>
</div>
</section>
</div><!-- /sezione -->
<?php get_footer(); ?>
As I have stated last night, you can do this in one query, and without a custom query.
I would like to enforce the fact that you should never use query_posts. query_posts breaks paginations, rerun queries slowing your page performance and breaks the main query object which is needed by many plugins or custom functions. It is truely an evil way to run custom queries which should be avoided at all costs. If you ever need to run custom queries, use WP_Query for paginated queries and get_posts for non paginated queries.
You should also never replace the main query with a custom one on the home page and any archive type page, this breaks page functionalities. Custom queries should only be run for secondary posts like sliders, featured content, related and popular posts and on page templates and static front pages to display custom posts. If you ever need to alter the main query on the homepage or and archive page, use pre_get_posts
Now, to solve your issue, you need one loop from the main query and a counter, in this case we will use the build in main query counter $wp_query->current_post (one note, this counter starts at 0, so post one in the loop will be 0, post two will be 1, etc).
From what I read from your code, the first code needs to be different from post two and three, and these are different from the next six
Lets put that into code
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
/*
* Display different outlay for post one
*/
if ( $wp_query->current_post === 0 ) {
// Do what needs to be done for post one
} elseif ( $wp_query->current_post >= 1 && $wp_query->current post <= 2 ) {
/*
* Do something for posts 2 and 3
*/
} elseif ( $wp_query->current_post >= 3 ) {
/*
* Do something for the rest of the posts
*/
}
}
}
EDIT
You can convert your code to
<?php
if (is_front_page() ) {
get_header( 'front' );
} else {
get_header();
}
?>
<section id="content" class="container">
<div class="row">
<div class="col-md-7 col-sm-7">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
if ( $wp_query->current_post === 0 ) { ?>
<article class="thumbnail thumbnail-principale expand-image">
<div class="featured-image">
<?php echo get_the_post_thumbnail($post_id, 'large', array('class' => 'img-responsive')); ?>
</div>
<div class="destacado"><h3>Destacado</h3></div>
<header class="testo-articolo">
<h3><?php the_title(); ?></h3>
<div class="entry-meta">
<p class="text-muted resume"><span><i class="fa fa-calendar"></i><?php the_time('j M y'); ?></span><span><i class="glyphicon glyphicon-user"></i><?php the_author(); ?></span><span><i class="fa fa-comment-o"></i><?php comments_popup_link('0', '1 Comentario', '% Comentarios'); ?></span></p>
</div>
<p><?php the_excerpt(); ?></p>
<?php comments_template(); ?><!-- da sistemare -->
</header>
</article>
</div>
<?php
} elseif ( $wp_query->current_post >= 1 && $wp_query->current post <= 2 ) { ?>
<div class="col-md-5 col-sm-5">
<article class="thumbnail thumbnail-destra expand-image">
<div class="featured-image">
<?php echo get_the_post_thumbnail($post_id, 'large', array('class' => 'img-responsive')); ?>
</div>
<header class="testo-articolo-destra expand-image">
<h3><?php the_title(); ?></h3>
<div class="entry-meta">
<p class="text-muted resume"><span><i class="fa fa-calendar"></i><?php the_time('j M y'); ?></span><span><i class="glyphicon glyphicon-user"></i><?php the_author(); ?></span><span><i class="fa fa-comment-o"></i><?php comments_popup_link('0', '1 Comentario', '% Comentarios'); ?></span></p>
</div>
<p><?php the_excerpt(); ?></p>
</header>
<div class="badge1"></div>
</article>
</div>
<?php
} elseif ( $wp_query->current_post >= 3 ) { ?>
<div class="col-md-4 col-sm-4">
<article class="thumbnail distanza expand-image">
<div class="featured-image">
<?php echo get_the_post_thumbnail($post_id, 'large', array('class' => 'img-responsive ingrandire-img')); ?>
</div>
<header class="testo-articolo">
<h3><?php the_title(); ?></h3>
<div class="entry-meta">
<p class="text-muted resume"><span><i class="fa fa-calendar"></i><?php the_time('j M y'); ?></span><span><i class="glyphicon glyphicon-user"></i><?php the_author(); ?></span><span><i class="fa fa-comment-o"></i><?php comments_popup_link('Ningún comentario', '1 Comentario', '% Comentarios'); ?></span></p>
</div>
<p><?php the_excerpt(); ?></p>
<p><a class="btn btn-default read-more" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php _e( 'Lee más', 'katartika' ); ?></a></p>
</header>
</article>
</div>
<?php }
endwhile;
endif; ?>
</div><!-- /row -->
<div style="text-align:center;">
<?php posts_nav_link(‘|’, ‘Prossimo’, ‘Precedente’); ?>
</div>
</section>
</div><!-- /sezione -->
<?php get_footer(); ?>
I don't know if it is the right way, but I got it:
<?php
if (is_front_page() ) {
get_header( 'front' );
} else {
get_header();
}
?>
<section id="content" class="container">
<div class="row">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
if (!is_paged() && $wp_query->current_post === 0 ) { ?>
<div class="col-md-7 col-sm-7">
<article class="thumbnail thumbnail-principale expand-image">
<div class="featured-image">
<?php echo get_the_post_thumbnail($post_id, 'large', array('class' => 'img-responsive')); ?>
</div>
<div class="destacado"><h3>Destacado</h3></div>
<header class="testo-articolo">
<h3><?php the_title(); ?></h3>
<div class="entry-meta">
<p class="text-muted resume"><span><i class="fa fa-calendar"></i><?php the_time('j M y'); ?></span><span><i class="glyphicon glyphicon-user"></i><?php the_author(); ?></span><span><i class="fa fa-comment-o"></i><?php comments_popup_link('0', '1 Comentario', '% Comentarios'); ?></span></p>
</div>
<p><?php the_excerpt(); ?></p>
<?php comments_template(); ?><!-- da sistemare -->
</header>
</article>
</div>
<?php
} elseif (!is_paged() && $wp_query->current_post >= 1 && $wp_query->current_post <= 2 ) { ?>
<div class="col-md-5 col-sm-5">
<article class="thumbnail thumbnail-destra expand-image">
<div class="featured-image">
<?php echo get_the_post_thumbnail($post_id, 'large', array('class' => 'img-responsive')); ?>
</div>
<header class="testo-articolo-destra expand-image">
<h3><?php the_title(); ?></h3>
<div class="entry-meta">
<p class="text-muted resume"><span><i class="fa fa-calendar"></i><?php the_time('j M y'); ?></span><span><i class="glyphicon glyphicon-user"></i><?php the_author(); ?></span><span><i class="fa fa-comment-o"></i><?php comments_popup_link('0', '1 Comentario', '% Comentarios'); ?></span></p>
</div>
<p><?php the_excerpt(); ?></p>
</header>
<div class="badge1"></div>
</article>
</div>
<?php
} elseif ( $wp_query->current_post >= 3 ) { ?>
<div class="col-md-4 col-sm-4">
<article class="thumbnail distanza expand-image">
<div class="featured-image">
<?php echo get_the_post_thumbnail($post_id, 'large', array('class' => 'img-responsive ingrandire-img')); ?>
</div>
<header class="testo-articolo">
<h3><?php the_title(); ?></h3>
<div class="entry-meta">
<p class="text-muted resume"><span><i class="fa fa-calendar"></i><?php the_time('j M y'); ?></span><span><i class="glyphicon glyphicon-user"></i><?php the_author(); ?></span><span><i class="fa fa-comment-o"></i><?php comments_popup_link('Ningún comentario', '1 Comentario', '% Comentarios'); ?></span></p>
</div>
<p><?php the_excerpt(); ?></p>
<p><a class="btn btn-default read-more" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php _e( 'Lee más', 'katartika' ); ?></a></p>
</header>
</article>
</div>
<?php
//new request for all the rest of post from page 2 onwards
} elseif ( is_paged() ) { ?>
<div class="col-md-4 col-sm-4">
<article class="thumbnail distanza expand-image">
<div class="featured-image">
<?php echo get_the_post_thumbnail($post_id, 'large', array('class' => 'img-responsive ingrandire-img')); ?>
</div>
<header class="testo-articolo">
<h3><?php the_title(); ?></h3>
<div class="entry-meta">
<p class="text-muted resume"><span><i class="fa fa-calendar"></i><?php the_time('j M y'); ?></span><span><i class="glyphicon glyphicon-user"></i><?php the_author(); ?></span><span><i class="fa fa-comment-o"></i><?php comments_popup_link('Ningún comentario', '1 Comentario', '% Comentarios'); ?></span></p>
</div>
<p><?php the_excerpt(); ?></p>
<p><a class="btn btn-default read-more" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php _e( 'Lee más', 'katartika' ); ?></a></p>
</header>
</article>
</div>
<?php }
endwhile;
endif; ?>
</div><!-- /row -->
<div style="text-align:center;">
<?php posts_nav_link('|', 'Prossimo', 'Precedente'); ?>
</div>
</section>
</div><!-- /sezione -->
<?php get_footer(); ?>
Related
I'm wanting to display Wordpress posts in a two column row using Bootstrap. Here's what I have, i feel it's close but the second post is displaying underneath the first one insead of displaying next to each other.
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<?php endif; ?>
<h2 class="blog-post-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h2>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
</div>
Any help would be appreciated!
Solved!
<div class="container">
<div class="row">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="col-lg-6 col-md col-sm-12 col-xs-12">
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<?php endif; ?>
<h2 class="blog-post-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h2>
</div>
<?php endwhile; else: ?>
<p>There are no posts to show</p>
<?php endif; ?>
</div>
</div>
I'm trying to pull the latest posts from the category "local-news" but I'm only seeing one of the two posts that exist for this category. I'm not sure if it's my if statement and/or while loop that's causing the issue. This is my first time developing a WP theme and using PHP so I'm a little confused as to how I could fix this. I'm not sure how to close my if statement or while loop either without causing a critical error or syntax error.
<div class="container">
<div class="row mt-4">
<?php
$args = array(
'category_name' => 'local-news',
'post_type' => 'post' ,
'orderby' => 'date' ,
'order' => 'DESC' ,
'posts_per_page' => 6
);
$q = new WP_Query($args);
$q -> the_post();
?>
if ( $q->have_posts() ) : {
while ( $q->have_posts() ) : the_post() {
<div class="card-body pb-0">
<div class="latest_news_cont">
<a href="<?php the_permalink() ?>">
<?php the_post_thumbnail(); ?>
</a>
<a href="<?php the_permalink() ?>">
<h5>
<?php the_title(); ?>
</h5>
</a>
<?php the_excerpt(); ?>
<p style="text-align:center;">Read more</p>
<br>
</div>
</div>
<div class="card-body pb-0">
<div class="latest_news_cont">
<a href="<?php the_permalink() ?>">
<?php the_post_thumbnail(); ?>
</a>
<a href="<?php the_permalink() ?>">
<h5>
<?php the_title(); ?>
</h5>
</a>
<?php the_excerpt(); ?>
<p style="text-align:center;">Read more</p>
<br>
</div>
</div>
</div>
</div>
Below I have fixed the initial issues I noticed:
<?php
$args = array(
'category_name' => 'local-news',
'post_type' => 'post',
'orderby' => 'date',
'order' => 'DESC',
'posts_per_page' => 6
);
$q = new WP_Query($args);
if ( $q->have_posts() ) :
while ( $q->have_posts() ) :
$q->the_post();
?>
<div class="card-body pb-0">
<div class="latest_news_cont">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<a href="<?php the_permalink(); ?>">
<h5>
<?php the_title(); ?>
</h5>
</a>
<?php the_excerpt(); ?>
<p style="text-align:center;">Read more</p>
<br>
</div>
</div>
<div class="card-body pb-0">
<div class="latest_news_cont">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<a href="<?php the_permalink(); ?>">
<h5>
<?php the_title(); ?>
</h5>
</a>
<?php the_excerpt(); ?>
<p style="text-align:center;">Read more</p>
<br>
</div>
</div>
<?php
endwhile;
endif;
I figured it out, had a lot of syntax issues and open php tags.
<?php
// the query
$the_query = new WP_Query(array(
'category_name' => 'local-news',
'post_status' => 'publish',
'posts_per_page' => 5,
));
?>
<?php if ($the_query->have_posts()) : ?>
<?php while ($the_query->have_posts()) : $the_query >the_post(); ?>
<div class="card-body pb-0">
<div class="latest_news_cont">
<a href="<?php the_permalink() ?>">
<?php the_post_thumbnail(); ?>
</a>
<a href="<?php the_permalink() ?>">
<h5>
<?php the_title(); ?>
</h5>
</a>
<?php the_excerpt(); ?>
<p style="text-align:center;">Read more</p>
<br>
</div>
</div>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p><?php __('No News'); ?></p>
<?php endif; ?>
why comments isn't appear on my theme although I confirmed showing comments! can anyone help please
these are screenshots
https://1drv.ms/u/s!AjjUt5PVIDDuklSRItYU-MAfSzP7?e=2tUhsi
https://1drv.ms/u/s!AjjUt5PVIDDuklV3poojMWiK6lAG?e=3nnult
this is my single post page
<?php get_header(); ?>
<div class="container">
<div class="row">
<?php
if(have_posts()){
while(have_posts()){
the_post(); ?>
<div class="post p-3 m-3 bg-light">
<?php edit_post_link('<span class="float-right">Edit <i class="fa fa-edit"></i></span>'); ?>
<h3>
<a href="<?php the_permalink() ?>">
<?php the_title() ?>
</a>
</h3>
<small class="post-author text-secondary mx-2"><i class='fa fa-user mx-1'></i><?php the_author_posts_link(); ?></small>
<small class="post-date text-secondary mx-2"><i class="fa fa-calendar mx-1"></i><?php the_time('F j, Y') ?></small>
<small class="post-comments text-secondary mx-2"><i class="fa fa-comments mx-1"></i><?php comments_popup_link('no comments', 'one comment', '% comments', 'comment-url', 'commenting is disabled'); ?></small>
<?php the_post_thumbnail('', ['class' => 'img-fluid img-thumbnail d-block']); ?>
<?php the_content(); ?>
<hr>
<span class='post-tags'>
<i class='fa fa-tags'></i>
<?php the_category(', ') ?>
</span>
<span class='d-block'>
<?php
if(has_tag()){
the_tags();
} else{
echo 'Tags: no Tags';
}
?>
</span>
</div>
<?php
}
}
echo '<div class="clearfix"></div>';
echo'<div class="post-pagination py-3 my-2 mx-auto">';
echo '<span class="mx-3">';
previous_post_link();
echo '</span>';
echo '<span class="mx-3">';
next_post_link();
echo '</span>';
echo '</div>';
?>
</div>
<?php
echo '<hr>';
comments_template('/comments.php',true);
?>
</div>
hello every one i would like help from you my problem iswhen i'm using the_excerpt on wordpress and click on read more it doesn't give me the full article it give me the article page but with text cutted and read more again
he is my code for content.php
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php
if ( is_single() ) {
the_title( '<h1 class="entry-title">', '</h1>' );
} else {
the_title( '<h2 class="entry-title">', '</h2>' );
}
if ( 'post' === get_post_type() ) : ?>
<div class="post-details">
<i class="fa fa-user"></i> <?php the_author( ); ?>
<i class="fa fa-clock-o"></i><?php the_date( ); ?>
<i class="fa fa-folder-open"></i> <?php the_category(' ,' ); ?>
<i class="fa fa-tags"></i> <?php the_tags( ); ?>
<div class="post-comment-tags">
<i class="fa fa-comments"></i><?php comments_number(0,1,'%' ); ?>
</div>
</div><!-- postdetails -->
<?php
endif; ?>
</header><!-- .entry-header -->
<?php if(has_post_thumbnail()){ ?>
<div class="post-image">
<?php the_post_thumbnail('large'); ?>
</div> <!-- postimage -->
<?php } ?>
<div class="post-extrait">
<?php the_excerpt(); ?>
</div>
</article><!-- #post-## -->
screenshoot from my desktop
http://i.stack.imgur.com/6SYId.jpg
http://i.stack.imgur.com/XKjiI.jpg
I see your problem in content page that it dont show the full content you are using
<?php the_excerpt(); ?>
you should use
<?php the_content(); ?>
I am working on a website for a client and I specifically needed to modify a given wordpress template. The template uses the get_template_part function to call the content. So for the loop on the index page it should be showing the_date under the header but for some reason it is showing up on some of the posts and not all.
index.php
<?php get_header(); ?>
<!-- Content -->
<div class="container contentarea">
<div class="row">
<div class="column-content">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<!-- Call content.php -->
<?php get_template_part( 'content' ); ?>
<?php endwhile; ?>
<div class="clearfix"></div>
<div class="paging">
<?php if(function_exists('lugada_kriesi_pagination')) : lugada_kriesi_pagination(); else: ?>
<?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?>
<div id="nav-below" class="navigation">
<div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">«</span> Older posts', 'newzeo' )) ?></div>
<div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">»</span>', 'newzeo' )) ?></div>
</div>
<?php } endif; ?>
</div>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title">Nothing Found</h1>
</header>
<div class="entry-content">
<p>Sorry, we can't find post you request. Please try search for a related post.</p>
</div>
</article>
<?php endif; ?>
</div> <!-- #content -->
</div> <!-- .column-content -->
<div class="column-sidebar nomargin">
<?php get_sidebar(); ?>
</div>
</div>
</div>
<?php get_footer(); ?>
content.php
<div class="content-box bucket">
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?> itemscope itemtype="http://schema.org/Article" >
<h2 class="entry-header">
<div class="entry-meta clearfix" >
<!-- Sticky post -->
<?php if (is_sticky()) : ?>
<div class="sticky-label"></div>
<?php endif; ?>
<!-- Post title -->
<?php the_title(); ?>
</div> <!-- .entry-meta -->
</h2> <!-- .header -->
<!-- Content -->
<div class="entry-content clearfix" itemprop="description">
<?php the_date('','<p><strong>','</strong></p>',true); ?>
<?php the_content('Continue reading'); ?>
<div class="clearfix"></div>
<?php wp_link_pages( array('before' => '<div class="page-link"> <span> Pages: </span>', 'after' => '</div>')); ?>
</div>
<div class="entry-meta footerbox" >
<!-- Category -->
<span class="cat-links">
<span>Posted in</span>
<?php echo get_the_category_list(', '); ?>
</span>
<!-- If single & have tag -->
<!-- Tag -->
<?php if ( is_single() ): if (has_tag()) : ?>
<span class="sep"> | </span>
<span class="tag-links">
<span>Tagged</span>
<?php echo get_the_tag_list('',', ',''); ?>
</span>
<?php endif; ?>
<?php edit_post_link('Edit', '<span class="edit-link"><span class="sep"> | </span>', '</span>'); ?>
<div class="socialshareboxsingle clearfix">
Share this post, let the world know <?php lugada_social_button();?>
</div>
<?php endif; ?>
</div> <!-- .footer -->
</div> <!-- article -->
</div>
<hr class="post-shadow"/>
<!-- If its single, a user has filled out their description and this is a multi-author blog, show a bio on their entries -->
<?php if ( is_single() ) : ?>
<?php if ( get_the_author_meta( 'description' ) && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : ?>
<div class="content-box">
<div id="author-info">
<div id="author-avatar">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), 80 ); ?>
</div>
<div id="author-description">
<h2 >About <?php echo get_the_author(); ?></h2>
<?php the_author_meta( 'description' ); ?>
</div>
<div id="author-link" class="clearfix">
<?php if ( get_the_author_meta( 'user_url' )) : ?>
<span>Add my circles on Google+ : </span>
<span itemprop="author"><?php echo get_the_author(); ?></span>
<br/>
<?php endif; ?>
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
View all posts by <?php echo get_the_author(); ?><span class="meta-nav">→</span>
</a>
</div>
</div>
</div>
<hr class="post-shadow"/>
<?php endif; endif; ?>
They're not random posts. Read the Codex:
When there are multiple posts on a page published under the SAME DAY, the_date() only displays the date for the first post (that is, the first instance of the_date()). To repeat the date for posts published under the same day, you should use the Template Tag the_time() or get_the_date() (since 3.0) with a date-specific format string.
Change:
<?php the_date('','<p><strong>','</strong></p>',true); ?>
To:
<p><strong><?php the_time('F j, Y'); ?></strong></p>