Most recent blog posts displaying incorrectly
-
I hope you can help me – please!
This is my website: jerichoconsulting.co.uk
You will note at the bottom of the homepage the blog posts are displaying incorrectly. These are supposed to display in date order with the most recent in the top left and the oldest of the four in the bottom right. The theme was developed for me by a web company; however just before we parted ways they botched an earlier error and it has left me with this.
There is a specific page template for the front page and I roughly know where the relevant code is on that page for the recent blog posts, however I don’t know what exactly to replace; and with what!
The code that I believe to be relevant to the section of the page in question is:
<div class="read-all-about"> <div class="wrapper"> <div class="read-all-about-inner"> <div class="all-about-tittle"> <span>Read All About It!</span> </div> <div class="all-about-blog"> <?php $i = 1; $query = new WP_Query(array( 'post_type' => 'post', 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC')); if (have_posts()) : while ( $query->have_posts() ) : $query->the_post(); $postid = $post->ID; if(get_field('blog_display') == "yes" && $i <= 4) { $link = get_permalink(); $title = get_the_title(); $attach_id = get_post_thumbnail_id(); $featured_image = wp_get_attachment_image_src( $attach_id,'full'); $excerpt = get_the_excerpt(); $date = get_the_date(); ?> <div class="blog-view <?php if($i%2 == 0) echo ' right-view"'; else echo '" style="float:left"';?> > <div class="blog-img"> <a>"><img src="<?php echo $featured_image[0]; ?>" alt="<?php echo basename($featured_image[0]); ?>" /></a> </div> <div class="blog-text"> <a>"> <h3><?php echo $title; ?></h3> </a> <span><?php echo $date; ?></span> <p> <?php $str = $excerpt; $string = (strlen($str) > 70) ? substr($str,0,70).'...' : $str; echo $string; ?> <a>">Continue reading</a></p> </div> </div> <?php $i++; } ?> <?php endwhile; ?> <?php else: ?> <div class="error"> <?php _e('Not found.'); ?> </div> <?php endif; ?> </div>
Can anyone help?
- The topic ‘Most recent blog posts displaying incorrectly’ is closed to new replies.