Site logo

Archived topic

how to hide read more text in tablet and mobile view

5 replies · Started by vanya on September 15, 2019

Viewing posts 1–6 of 6

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.

https://prnt.sc/p6mpnn

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

The above code did not work; however, I did try some other css and it worked :)

Awesome :)

This archived topic is closed to new replies.