Skip Navigation

[Resolved] More tag Excerpt

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display post excerpt

Solution:
Using view's [wpv-post-excerpt] shortcode you can display the post excerpt.

You can find proposed solution with the following reply:
https://toolset.com/forums/topic/more-tag-excerpt/#post-419658

Relevant Documentation:
https://toolset.com/documentation/views-shortcodes/#wpv-post-excerpt

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by Ole Andreas Vekve 6 years, 4 months ago.

Assigned support staff: Minesh.

Author
Posts
#419614

I am trying to: Add excerpts with the more tag. Only show the text before the more tag.

I visited this URL:
https://toolset.com/forums/topic/excerpt-with-read-more-tag/
https://toolset.com/documentation/views-shortcodes/
https://toolset.com/forums/topic/read-more-not-working/

I use:

[wpv-post-excerpt]

I expected to see just text before more tag. But I see text both before and after the more tag.

Any guesses?

#419619

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

This is how post excerpt displayed with 'read more' text normally.

[wpv-post-excerpt length="30" count="word" more=" Read More"]

1)
Could you please check if that you have added the <!--more--> tag to the post content itself and trying to display a small excerpt of the post?

2)
Could you please share problem URL?

#419626

Thank you,

I have added the code. However the problem is the same.

URL: hidden link

#419628

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I need to check how you setup your HTML content.

As I understand you want output as:
text before - read more - text after - correct?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#419658

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Actually, this is how post excerpt works.

For example

[wpv-post-excerpt length="6" count="word" more="Read More"]

This code will count six words and display it and after 6 words it will display "Read More".

More info:
https://toolset.com/documentation/views-shortcodes/#wpv-post-excerpt

You want to display:
some text before - read more - some text after

Above approach will need custom programming as how we can determine from where we need to split the string for after read more text.

You May try to add filter as suggested here and adjust the code accordingly achieve the output you are looking for:
https://toolset.com/forums/topic/read-more-link-in-line-with-excerpt/#post-80336

#419662

Hello,

Thanks.

I understand. I have earlier used the following, but can't be included because its within the loop. And also it's PHP.

<?php
     // Fetch post content
     $content = get_post_field( 'post_content', get_the_ID() );
                                                        
    // Get content parts
    $content_parts = get_extended( $content );
                                                        
    // Output part before <!--more--> tag
     echo $content_parts['main'];
?>

Maybe something that can be included, or...?

#419663

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

you need to convert above code into custom shortcode and then return the content from custom shortcode and display the content by adding custom shortcode to your view output.

#419664

Okay. Thanks.