No Sidebar Pro – Change Featured Image To Display Full Width On Front Page

By default, the No Sidebar Pro child theme by StudioPress displays full width for the most recent post and then in a grid for all other entries in a loop like you see in the following screenshot:

This tutorial provides the instructions to modify the code which enables you to display the featured image on all post entries, full width. The images will display full width on the 1st page of the front page like you see in the following screenshot:

The 2nd and subsequent pages will display the default which you see in the 1st screenshot at the beginning of this tutorial.

Here’s the instructions:

Simply change the code for the ns_post_class function which starts on line 81 of front-page.php to the following:

function ns_post_class( $classes ) {

    global $wp_query;

    $classes[] = 'first-featured';
		
    return $classes;

}

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.