• We need a way to EXCLUDE pages (such as startpage, contact page) using the plugin.

    Right now your plugin is not usable for me because of this – it is a show stopper.

    Please add a field to recognize a comma separated list of post ids to exclude.

    PS: It would also be good if you would include a MINIMUM reading length/word count for the plugin to show the text. Because it is obvious that a small posting with 200 words is readable under a minute. By entering a minimum word count we can show this label only on actually long pages.

    • This topic was modified 5 years, 7 months ago by jackstron.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jason Yingling

    (@yingling017)

    Thanks for the feature suggestions. I’ll add them to the list of new features.

    In the meantime here is a code snippet you could use in functions.php to create array of post ids to exclude.

    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') );
    	}
    }

    Jason,

    I second this request, but in the meantime, thanks for the workaround which does the job.

    Mark

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Exclude posts is needed’ is closed to new replies.