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.
1 2 |
//* Add support for after entry widget add_theme_support( 'genesis-after-entry-widget-area' ); |
Now 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:
1 2 3 4 5 6 7 8 9 10 11 12 |
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 $qargs; 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.
Leave a Reply