• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WBXPress.NET

Website Developement Guide

  • apache2
  • nginx
  • mysql
  • php7
  • SSL
  • wordpress
  • genesis
  • caching
  • seo

Featured Image in Genesis Theme – Best Practice

Updated on 5th June 2018 Leave a Comment

Have you checked whether your site images are showing in google image search result?

I recently checked and found that, all images are showing up! But, NO images are showing when I searched for large images.

After a comprehensive study we narrowed down few best practices.

1. What should be the Featured Image size?

Featured Image dimension should be 1280 x 720 pixel. Google treats images having minimum dimension of 1280 by 720 pixel as large image.

2. Set a Default Featured Image

add_filter( 'genesis_get_image_default_args', 'wbxp_fallback_featured_image' );
function wbxp_fallback_featured_image( $defaults ) {
	$defaults[ 'fallback' ] = 18853; // attachment ID of the default image
	return $defaults;
}

After setting up the default featured image we got the following result:


In the first post there is no featured image but it shows a default image. The second post has a featured image already set.

3. Set Media Settings properly

Any image when uploaded into wordpress, it will automatically creates few more instances of that image of different size based on media settings. Recommended media settings is shown below:


Thumbnail size: 160 x 90; Medium size: 640 x 360; Large size: 1280 x 720.

4. Regenerate Thumbnails

After saving the above settings, we need to regenerate the thumbnails. Simple use the plugin: Regenerate Thumbnails

5. Display featured image at Single posts/page

Add the following code into theme functions.php file.

add_action( 'genesis_before_entry', 'featured_post_image', 8 );
function featured_post_image() {
  if ( !is_singular( ))  return;
  the_post_thumbnail('large', ['class' => 'featured-image', 'title' => get_the_title()]);
}

Add the following into style.css for proper styling

.featured-image {
	margin-bottom: 30px;
}

Filed Under: wordpress Tagged With: genesis, seo

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Most Popular Posts

  • Remove/ Defer Render-blocking JavaScripts
  • Customizing Genesis eleven40-pro Theme
  • Free Genesis Child Theme by WBXPress
  • Host Multiple Sites with SSL in Ubuntu 18.04
  • 25 Ways to Boost Website Traffic that Really Work

Recent Comments

  • Ruhul on Customizing Genesis eleven40-pro Theme
  • Priya Agarwal on Customizing Genesis eleven40-pro Theme
  • mimi roy on Remove/ Defer Render-blocking JavaScripts
  • danish choudhary on Customizing Genesis eleven40-pro Theme
  • Radhe on Customizing Genesis eleven40-pro Theme

Copyright © 2021 · Powered by WordPress · Log in