Show more contents using "more" tag in the testimonial page

Support Forums for LiveMesh Themes & Plugins Forums Invent Theme Support Show more contents using "more" tag in the testimonial page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #26659
    palmtree
    Participant

    I want this page
    https://www.livemeshthemes.com/invent/home-2/#testimonials2

    Not to show content after “more” tag (by inserting more tag it works now)

    But this page
    https://www.livemeshthemes.com/invent/testimonials/

    To show content after “more tag (which doesn’t work). Currently if I use more tag, contents after more tag is not visible in https://www.livemeshthemes.com/invent/testimonials/ as well.

    I want to hide certain content of each testimonial in front page but display in testimonial dedicated page.

    Is there any way to modify a bit of code inside template-testimonials.php?

    #26708
    Raghavendra
    Moderator

    In the template-testimonials.php, pls replace the line no. 73 containing the_content() with –

                                    global $more; $more = -1;
    
                                    the_content();
    
                                    $more = 0;

    You can copy over the template-testimonials.php into your child theme to prevent updates to theme from removing your change.

    #26712
    palmtree
    Participant

    Thanks it works!
    Meteorite, is there any way to get rid of [···] for more tag output only in this particular testimonial section?
    I have tried the_content('',false,'') but did not work.

    #26714
    Raghavendra
    Moderator

    There is more information available here-

    https://codex.wordpress.org/Customizing_the_Read_More

    #26718
    palmtree
    Participant

    Actually whatever rules I applied, they are ignored…
    I have also tried to add following to functions.php but also didn’t work.

    function my_excerpt_more($more) {
    	return '';
    }
    add_filter('excerpt_more', 'my_excerpt_more');
    #26728
    Veena
    Moderator

    Can you pls try this –

    
    function change_excerpt( $text )
    {
    	$pos = strrpos( $text, '[');
    	if ($pos === false)
    	{
    		return $text;
    	}
    	
    	return rtrim (substr($text, 0, $pos) );
    }
    add_filter('get_the_excerpt', 'change_excerpt');
    
    #26729
    Veena
    Moderator
    #26730
    palmtree
    Participant

    Phoenix,Thanks for trying.

    Your code also didn’t do anything. It seems like any code I put is ignored..
    If I use <?php the_excerpt(); ?> the after more tag I cannot see any text in the testimonial page seen at https://www.livemeshthemes.com/invent/testimonials/

    As long as I keep <?php the_content(); ?> with the method meteorite suggested, the more tag works although it outputs [···].

    But at the end of the day, if more tag works that is the main purpose! Getting rid of [···] is just for very little designing purpose. I can live with it:)

    Thanks for your support!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Invent Theme Support’ is closed to new topics and replies.