Support » Plugin: Timeline Express » Hiding Read more-link when there’s no more text

  • How do I hide the “Read more”-link when there’s no more text to read? While translating it?

    • This topic was modified 1 year, 3 months ago by audunmb.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Code Parrots

    (@codeparrots)

    Hi @audunmb

    There should already be conditional read more links, so that the read more links are only present when the announcement content exceeds the length of the announcement excerpt.

    As for translating the read more links into your language, you can do so by using the following code snippet:

    function custom_read_more_text( $text, $post_id ) {
    
       return 'mehr';
    
    }
    add_filter( 'timeline_express_read_more_text', 'custom_read_more_text', 10, 2 );

    Let us know if that helps!

    OK.

    I used this code that I found on your website and thought that was the reason the conditional read more link didn’t work:

    /**
     * Remove the default Timeline Express read more links
     * @param  string 	$read_more  Default HTML markup for the read more link.
     * @param  integer  $post_id    Post ID of the current announcement iteration.
     * @return null
    
    function custom_timeline_express_readmore( $read_more, $post_id ) {
         return '';
    }
    add_filter( 'timeline_express_read_more_link', 'custom_timeline_express_readmore', 10, 2 );
    
    /** 
     * Generate a new custom 'Read More' link for Timeline Express
     * @return string HTML markup for the new read more link.
    
    function generate_custom_read_more_link() {
          global $post;
          echo wp_kses_post( '<a href="' . get_the_permalink( $post->ID ) . '" class="custom-class">Les videre</a>' );
    }
    add_action( 'timeline-express-after-excerpt', 'generate_custom_read_more_link' );

    The new code is simpler, which is great, but conditionatl Read more still doesn’t work.

    Please take a look at the linked page.

    Plugin Contributor Code Parrots

    (@codeparrots)

    Ah, you are correct. It looks like the conditional read more feature is something we introduced into the pro version.

    It seems like something that might be beneficial to introduce into the free version as well, here on WordPress.org.

    It does involve a bit of tweaking and a few new functions added to the plugin to get it working. If you are familiar with code, and comfortable editing plugin files we can help point you in the right direction. Otherwise, it may be best to hold off until we can get the new version pushed out with this feature included.

    Ok, so for now it’s a Pro feature?

    Plugin Contributor Code Parrots

    (@codeparrots)

    Correct, until we can get a patch pushed out to include it here.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hiding Read more-link when there’s no more text’ is closed to new replies.