Archived topic
Best method to hide output for mobile?
3 replies · Started by George on October 26, 2020
New GeneratePress Premium user here :)
I am using a modified snippet that was provided on this forum to add rt_reading_time shortcode to right after the author display.
add_filter( 'generate_post_author_output', function( $output ) {
return $output . do_shortcode( '[rt_reading_time label=" Reading Time:" postfix="minutes " postfix_singular="minute "]' );
} );
The resulting HTML is
<span class="span-reading-time rt-reading-time"><span class="rt-label rt-prefix"> Reading Time:</span> <span class="rt-time"> 30</span> <span class="rt-label rt-postfix">minutes </span></span>
So what is the best way to hide this only for mobile visitors ? Does GeneratePress have inbuilt class for this?
thanks
George
Hi there,
Welcome to GP!
I believe this is what you are looking for:
https://docs.generatepress.com/article/responsive-display/#using-our-hide-on-classes
Cheers Leo thanks for the welcome and pointer !
No problem :)