Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Joyn › Excerpt HTML Stripped
New Landing › How can we help? › Themeforest Theme Support › Joyn › Excerpt HTML Stripped
- This topic has 11 replies, 4 voices, and was last updated 7 years by David Martin – Support.
-
Posted in: Joyn
-
June 21, 2016 at 4:23 am #276021
Hoping someone could point me in the right direction. After a recent update to the Swift Framework my custom excerpts on blog posts are no longer retaining their formatting. HTML placed in the Custom Excerpt meta box is being removed and all content is wrapped in a paragraph tag.
For example on save:
<h3>This is a custom header</h3> <h4>Here is the subheader</h4>
Becomes:<p>This is a custom header Here is the subheader</p>
Any ideas? Thanks!
June 22, 2016 at 12:14 pm #276390Hi,
It is correct because HTML content output damage the layout. So we use plain text wrap with only P tag.
Thanks
MohammadJune 22, 2016 at 12:31 pm #276399Mohammad, how come this worked prior to the latest Swift Framework update? Why would non-paragraph tags damage the layout? You’ve provided a Custom Excerpt meta input box which previously accepted HTML markup.
Is it possible to turn this functionality back on and stop the HTML tags from being stripped? Thanks!
June 22, 2016 at 12:37 pm #276404Hi,
Are you using the Blog element of Swift page builder to display the blog posts?
Thanks
MohammadJune 22, 2016 at 4:06 pm #276483Mohammad, yes I’m using the Swift Page Builder Blog element and then a Recent Post module from the Page Builder as well. I have custom text I’m trying to display in a specific format via the Custom Excerpt meta box. Appreciate your help on this.
June 23, 2016 at 11:59 am #276660Hi
Unfortunately only plain text is supported as a post excerpt
– Kyle
June 23, 2016 at 7:39 pm #276789This reply has been marked as private.June 24, 2016 at 7:29 am #276864Ok I will forward this to the developer for you to see if anything has changed
– Kyle
June 24, 2016 at 10:13 pm #277086Thank you very much!
June 27, 2016 at 4:11 pm #277456Hi,
Can you link me to the post you are trying to do this on and also add a WP login?
Thanks.
June 27, 2016 at 5:47 pm #277493David,
I was able to resolve this, but admittedly it seems like a bit of hack. In a more recent version of the Swift Framework:
function sf_custom_excerpt( $custom_content, $limit ) { $content = explode( ' ', $custom_content, $limit );
Was changed to:
function sf_custom_excerpt( $custom_content, $limit ) { $content = wp_trim_words( $custom_content, $limit );
Form some reason
wp_trim_words
strips the HTML content in the Custom Excerpt where asexplode
leaves it intact. It would be great to understand why the change. Also, would love to do this via a function in functions.php instead of overwriting the core files. Initially I was looking at updatingthe_excerpt()
to allow for specific HTML tags, until I realized you are using your own custom excerpts.Thank you!
June 27, 2016 at 5:57 pm #277500Hi,
Great, this is what I was going to refer you to, the trouble is as you discovered those functions cannot be overridden currently in a child theme.
I’m going to feedback to Ed (lead dev) to see if we can get this added so we can override this going forward.
Cheers,
David. -
Posted in: Joyn
You must be logged in and have valid license to reply to this topic.