• XEN DEVELOPMENT is a developer's resource for new developers wanting to build XenForo 2 add-ons. Experienced developers are also welcome to share their experienes and knowledge. This site is not affiliated with XenForo or a replacement for the official XenForo developer forums.

Solved Problems with Excerpt In Xenforo: "Wordpress Trim" Showing Entire Post

Status
Not open for further replies.

Laron

New member
Lifetime License
WordPress version: Latest Version
XenForo version: Latest Version
XenWord version: 2018.06.14-NR

What WordPress theme are you using?

Newspaper

To the best of your abilities please describe the specific problem you are experiencing:

1) The excerpt on the xenforo thread is coming up with the entire contents / character count of the post, when 500 characters are set using the "Wordpress Trim" option.

FYI:
The second issue here is that when an image is inserted before the text at the top of the post, the image doesn't show in the excerpt in Xenforo at all — however, I am fine with the image not showing, as I just want text, so this is for your information.

How can this be repeated?

Create a new post with more than 500 characters, publish it.

Current settings:

current.jpg

Original bug information from the former website is below to provide some history around this issue. (https://www.tuxreports.com/community/threads/excerpt-on-xenforo-not-properly-showing.610807/#post-1944737)

"To the best of your abilities please describe the specific problem you are experiencing:​
The excerpt on the xenforo thread is not showing the number of characters/words I have set it for all the time. For some posts it does, for others it will only show a small number of words. This needs to be a constant number as I need the reader to be able to see a decent summary length with the automatically created thread, as then they will know if they want to read it or not. "​


 

LPH

Flight Director
Staff member
Yes. It appears large numbers cause an issue for the WordPress trim. This is a WordPress method being called. Filtering might work but that'll take time because I'd basically be re-writing the WordPress's function.
 

Laron

New member
Lifetime License
So all I'm looking for here is to be able to specify the character or word count for a short excerpt of the beginning of the post which shows up in the thread (which is what it was doing). It wasn't a big deal having the word count cut from 500 down to 333, whatever it was, when an image was inserted, but I thought I should let you know as it makes a bit of a difference in terms of the reader understanding what the post/article is about.

I would say don't worry if it's a change that will take a lot of time.

I assume "excerpt" is what I need to have the setting on now, with the Custom excerpt length set to 500 and it should be back to normal (I haven't tested this yet). Or do you need to do a change to return the custom excerpt to what it was originally? Should I downgrade to the latest public release?
 

LPH

Flight Director
Staff member
In trying to understand what you are trying to do with the site, try to work with using the excerpt option.
 

Laron

New member
Lifetime License
When I post using just "excerpt", no excerpt is shown. All that is shown is "XXX submitted a new article. Click here to continue reading the entire article." So right now I can't seem to work out a way to do an excerpt.
 

LPH

Flight Director
Staff member
Choosing excerpt means XenWord pulls from the WordPress excerpt area. If you don't fill it in then it would be blank.
 

LPH

Flight Director
Staff member
"To add an excerpt to a post, simply write one in the Excerpt field under the post edit box. An excerpt can be as short or as long as you wish. Usually, given its purpose, a couple of sentences is fine. If adding the excerpt manually, you may use (some) HTML formatting and the tags will not be stripped.

Note: As of WordPress version 3.1, some screen options on the Post & Page edit Administration Panels are hidden by default. The Excerpt field is hidden by default if it has not been used before."
 

Laron

New member
Lifetime License
Ok, so that's not want I'm looking for, I'm looking for an automatic excerpt from the contents of the post based on what is written first — up to a certain word or character limit.
 
Status
Not open for further replies.
Top