- WordPress 4.0+
- Genesis 2.2.0+
- Atmosphere Pro Theme
- Genesis Featured Posts Combo Plugin
Drag and drop the “Genesis Featured Posts Combo” widget into Front Page 3 widget area. Now configure the following options:
- Layouts: Full Width (layout no. 7)
- Post Type: Post. You can select CPT.
- Check Show Post Title checkbox
- Check Post Info checkbox
- Enter “[post_date] <span class=”sep”>/</span> [post_categories before=""]” into Post Info textbox
- Post Content Limit: 220
- Check Show Featured Image checkbox
- Image Size: Front Page Featured (640×640)
- Number of Posts: 3
Hit on “Save” button and save the widget.
Now add the following scripts in your functions.php file.
My GFPC widget ID is gfpc-widget-2. I created the filter and hooks based on my GFPC widget ID. You’ll replace the widget ID with your GFPC widget ID. Explaining the code at below:
15-16: Returning early if user is not visiting the home page
19-20: Create a new global variable which is using for featured image alignment and post