Archived topic
how to hide read more text in tablet and mobile view
5 replies · Started by vanya on September 15, 2019
Hello,
I am using custom excerpt and this disables the read more option. However, I am using this php code to show read more text even while using custom excerpt.
add_filter( 'wp_trim_excerpt', 'tu_excerpt_metabox_more' );
function tu_excerpt_metabox_more( $excerpt ) {
$output = $excerpt;
if ( has_excerpt() ) {
$output = sprintf( '%1$s %3$s',
$excerpt,
get_permalink(),
__( 'Read more ', 'generatepress' )
);
}
return $output;
}
I would like to hide the read more text on desktop and mobile view.
Please help.
Hi there,
so to be clear:
1. You're displaying the Custom Excerpt.
2. You want to keep the readmore link
3. And remove the Excerpt text?
Yes, i want to keep the read more link visible but only on desktop view.
I would like to hide read more link on tablet and mobile view.
Plz help
Give this a shot:
@media (max-width: 768px) {
a.read-more {
display: none;
}
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
Let me know :)
The above code did not work; however, I did try some other css and it worked :)
Awesome :)