[Resolved] how to hide read more text in tablet and mobile view

Home Forums Support [Resolved] how to hide read more text in tablet and mobile view

Home Forums Support how to hide read more text in tablet and mobile view

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1010323
    vanya

    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

    #1010492
    David
    Staff
    Customer Support

    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?

    #1011033
    vanya

    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

    #1011059
    Leo
    Staff
    Customer Support

    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 πŸ™‚

    #1011278
    vanya

    The above code did not work; however, I did try some other css and it worked πŸ™‚

    #1011725
    Leo
    Staff
    Customer Support

    Awesome πŸ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.