Copy & paste this code to the end of your child themes functions file and swap out the post id in the conditional tag.
add_action( 'get_header', 'remove_authorbox_single_post' );
function remove_authorbox_single_post(){
if ( is_single( 1362 ) ) {
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
}
}
In this example, 1362 is the post ID. The following part of the code is what you need to modify.
is_single( 1362 )
Or, like this if you want to use the post slug :
is_single( 'your-post-slug' )
Remove From Multiple Posts
You can use a array with the is_single conditional tag like this :
is_single(array( 1, 2, 3 ) )
Where 1, 2 and 3 are the post i.d’s you want the author box removed from. Full code :
add_action( 'get_header', 'remove_authorbox_single_post' );
function remove_authorbox_single_post(){
if ( is_single(array( 1, 2, 3 ) ) ) {
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
}
}
You can use either the post id or permalink slug inside the is_single()
conditional tag to target specific posts.
Was This Tutorial Helpful?