Displaying 3 latest posts after entry widget area

How to display 3 latest posts after entry widget area using Genesis Featured Posts Combo plugin? In this article I am showing this.

First enabling the after entry widget area using following script. Adding the code in functions.php file.

//* Add support for after entry widget
add_theme_support( 'genesis-after-entry-widget-area' );

gfpc-widget-settingsNow drag&drop the Genesis Featured Posts Combo widget at After Entry sidebar. Checkout the widget settings from screenshot. Please note that Genesis Featured Posts Combo is a premium plugin for Genesis Framework only. Yet you have not this plugin then you can buy it from here.

Lastly I am using the filter and excluding the current post from the list. I added the following code in functions.php file:

add_filter( 'gfpc_query_args_gfpc-widget-7', 'gd_exclude_current_post', 10, 2 );
function gd_exclude_current_post( $qargs, $instance ) {

  if( ! is_single() )
    return;
    
  global $post;
  
  $qargs['post__not_in'] = array( $post->ID );  
  return $qargs;
  
}

I used “gfpc_query_args_gfpc-widget-7” filter and customized the default query args. Here gfpc-widget-7 is the Genesis Featured Posts Combo widget ID. You will find the correct widget ID and change the filter name.

Now I am getting this output from my single post.

latest-posts

Share This Article

Subscribe Membership Plan ($9.99/mo)

  • Get full access to all premium tutorials
  • Get Support for the posted content
  • Request for specific how-to tutorials
  • Cancel the subscription at anytime

Reader Interactions

Leave A Reply

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