Plugin Author
DaveE
(@dpe415)
Hi Mppeter,
You’d need to paste this code into your theme’s functions.php file. Cheers!
Thanks for your fast answer. I didn’t mention but i tried that too and its not working.
I’m using Genesis framework.
Plugin Author
DaveE
(@dpe415)
Sorry for the delay,
I had a chance to test out the filter using the Genesis framework and their sample theme (the sample child theme StudioPress bundles with the Genesis Framework) and it works fine. Copied the code above into the genesis-sample theme’s functions.php file.
However, there is an exception. Are you getting posts by Post Type and Taxonomy & Term or by Post ID in the widget? If you’re getting posts by ID, then the filter wouldn’t apply. In that case, you’d want to adjust the filter as follows:
function current_recent_post( $args ) {
if( is_singular() )
$args['post__not_in'] = array( get_the_ID() );
return $args;
}
add_filter( 'dpe_fpw_args', 'current_recent_post' );
If you aren’t getting posts by ID and the filter isn’t working, then the only other suggestion I have is that maybe another plugin or theme filter is causing the issue? I’ve found that other plugins/filters have been known to override FPW’s query settings when they use filters that are too lenient (apply to too many queries).
Hopefully that helps.
Thanks for looking after.
Im getting posts by ID but the code you provided not working.
Plugin Author
DaveE
(@dpe415)
I’m not sure I’d be able to help you further at this point. As I stated, I am able to get the filter working just fine with Genesis for both Tax & Term or Post ID options. I’d suggest disabling other plugins to see if maybe there is a conflict with another plugin used on the site.
Sorry
I guess the problem theme related. I disabled every plugin and still showing the same post.
It was more like a customization question. You could just send me away haha, but you spent your time testing it for me. Thank you very much.