• stefstefst3f

    (@stefstefst3f)


    Hi,

    I was just wondering how I could modify my Main Index php document to target the most recent post and make it span the width of the container?

    Here is the php code for my front page blog feed:

    <div class="container">
    		<div class="post_content">
    			<div class="home_posts">
    				<?php
    					$args2 = array(
    					'post_type' => 'post',
    					'posts_per_page' => 8,
    					'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),
    					);
    					$query = new WP_Query( $args2 );
    					if ( $query->have_posts() ) :
    						while ( $query->have_posts() ) : $query->the_post();
    							echo '<div class="grid_post">
    									<h3><a href="'.get_permalink().'">'.get_the_title().'</a></h3>';
    							$type = get_post_meta($post->ID,'page_featured_type',true);
    				 			switch ($type) {
    				 				case 'youtube':
    				 					echo '<iframe width="560" height="315" src="https://www.youtube.com/embed/'.get_post_meta( get_the_ID(), 'page_video_id', true ).'?wmode=transparent" frameborder="0" allowfullscreen></iframe>';
    				 					break;
    				 				case 'vimeo':
    				 					echo '<iframe src="https://player.vimeo.com/video/'.get_post_meta( get_the_ID(), 'page_video_id', true ).'?title=0&byline=0&portrait=0&color=03b3fc" width="500" height="338" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
    				 					break;
    				 				default:
    									echo '<div class="grid_post_img">
    												<a href="'.get_permalink().'">'.get_the_post_thumbnail().'</a>
    											</div>';
    									break;
    							}
    							echo '<div class="grid_home_posts">
    										<p>'.dess_get_excerpt(120).'</p>
    									</div>
    								</div>
    								';
    						endwhile;
    				?>

    And a link to my site: https://www.whycatwhy.com/

    Under the slider, I’d love to be able to target the most recent post (In this case, “7 ways to entertain your cats”) and make it span the space of 2 posts, while having the rest of it drop down to the next row.

    I’m sure there’s a way to do this, but I’m not strong in php. Thanks so much in advance!

  • The topic ‘How do I make my most recent post on the front page full width?’ is closed to new replies.