My Genesis little one theme comes with its personal plugin to customise the design. They lately added a Subsequent/Prev put up thumbnails bock on the backside of the content material space.
The one drawback is that a few of my posts have dynamic content material that elongate the web page and trigger overlap points, so I would prefer to exclude these dynamic pages from utilizing this operate.
Throughout the themes plugin, they appear to make use of this so as to add it the backend setting and output:
add_action( 'after_setup_theme', __NAMESPACE__ . 'set_modern_prev_next', 101 );
/**
* Fashionable Prev + Subsequent
*/
operate set_modern_prev_next() {
if ( '1' === Settings::get( 'modern_prev_next' ) ) {
remove_action( 'genesis_after_entry_content', 'genesis_prev_next_post_nav', 5 ); // for Foodie, Prepare dinner'd.
add_action( 'genesis_after_entry_content', __NAMESPACE__ . 'modern_prev_next', 5 );
}
}
operate modern_prev_next() {
if ( ! is_singular( 'put up' ) ) { return; }
I have been going via the WordPress documentation, and located using filters might remedy this. I’ve added this snippet:
add_action('template_redirect', 'excl_modern_prev_next', 10 );
operate excl_modern_prev_next() {
if ( is_singular('11717') ) {
remove_action( 'genesis_after_entry_content', 'modern_prev_next', 5 );
}
}
Nevertheless it would not appear to work, I am unsure if it is the hook, precedence or one thing else that I am overlooking?
Thanks.