Last active
November 25, 2018 21:46
-
-
Save jasonyingling/97e3b699d48982051952f5c37af88fde to your computer and use it in GitHub Desktop.
Remove Reading Time from specific posts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'the_post', 'remove_reading_time_by_id' ); | |
function remove_reading_time_by_id( $post_object ) { | |
$post_ids = array( | |
'53', | |
'10', | |
); | |
global $reading_time_wp; | |
if ( in_array( $post_object->ID, $post_ids ) ) { | |
remove_filter( 'the_content', array( $reading_time_wp, 'rt_add_reading_time_before_content') ); | |
} else { | |
add_filter( 'the_content', array( $reading_time_wp, 'rt_add_reading_time_before_content') ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment