Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter converted

    (@converted)

    Hey, i need to disable reading time info on tag pages.

    • This reply was modified 4 years, 10 months ago by converted.
    Plugin Author Jason Yingling

    (@yingling017)

    Are your tag pages including the excerpt or the content of the post?

    For showing the_content you could do something like the following in your functions.php

    function reading_time_remove_tag_archive() {
    	if ( is_tag() ) {
    		global $reading_time_wp;
    		remove_filter('the_content', array($reading_time_wp, 'rt_add_reading_time_before_content'));
    	}
    }
    
    add_action( 'wp', 'reading_time_remove_tag_archive' );

    Or if using the_excerpt you could do:

    function reading_time_remove_tag_archive() {
    	if ( is_tag() ) {
    		global $reading_time_wp;
    		remove_filter('get_the_excerpt', array($reading_time_wp, 'rt_add_reading_time_before_excerpt'), 1000);
    	}
    }
    
    add_action( 'wp', 'reading_time_remove_tag_archive' );
    Thread Starter converted

    (@converted)

    Thx man your first code saved my life ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Tag pages excluded’ is closed to new replies.