Make All Post Look Like the Featured Post

Quite a few users have been asking about how they can get all of the posts on the home page to look like the first featured post. It’s actually quite simple. All you need to do is create a Custom Action (https://presswork.me/2011/custom-css-and-custom-actions/) that will repeat the style of the first post throughout all the other posts.

Add the following code snippet to your Custom Action file or to your child theme’s actions.php file:

remove_action('pw_index_sticky_post_middle', 'pw_posts_featured');
remove_action('pw_home_page', 'pw_home_page_featured_query');
remove_action('pw_index_middle','pw_loop');
add_action('pw_index_middle', 'custom_pw_home_page_featured_query');
function custom_pw_home_page_featured_query() {
	global $post, $notin, $paged, $pw;
	$pw = 1;
	$notin = pw_notin();
	$args = array(
		'post__not_in'  => $notin,
		"paged" => $paged
	);
	$the_query = new WP_Query( $args );
	while ( $the_query->have_posts() ) : $the_query->the_post();
	?>
	<article id="post-<?php the_ID(); ?>" <?php post_class("pw pw1"); ?>>
		<?php pw_actionBlock('pw_index_featured_post'); ?>
	</article>
	<?php
	endwhile;
}

Now all of the posts on your home page will have one large featured image above the post content. You can even emulate the second featured post that has only a thumbnail image to the left by changing the $pw variable to 2:

remove_action('pw_index_sticky_post_middle', 'pw_posts_featured');
remove_action('pw_home_page', 'pw_home_page_featured_query');
remove_action('pw_index_middle','pw_loop');
add_action('pw_index_middle', 'custom_pw_home_page_featured_query');
function custom_pw_home_page_featured_query() {
	global $post, $notin, $paged, $pw;
	$pw = 2;
	$notin = pw_notin();
	$args = array(
		'post__not_in'  => $notin,
		"paged" => $paged
	);
	$the_query = new WP_Query( $args );
	while ( $the_query->have_posts() ) : $the_query->the_post();
	?>
	<article id="post-<?php the_ID(); ?>" <?php post_class("pw pw2"); ?>>
		<?php pw_actionBlock('pw_index_featured_post'); ?>
	</article>
	<?php
	endwhile;
}