Skip Navigation

[Resolved] Paragraphs and HTML tags missing from divi content template

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

Problem:

The problem here is that the user added their content to the Product Description section of their products and added html to the texts as well.

Solution:

This is happening because the user is using the [wpv-post-excerpt] shortcode. This is actually stripping the html from the excerpt area.

A custom shortcode was used to resolve this.
Add this to your custom code in Toolset -> Settings -> Custom Code and activate it.

function wp_woo_prod_description() {
  $description = "Woocommerce is not active";
if ( class_exists( 'WooCommerce' ) ) {
    $product = wc_get_product( get_the_ID() );
    $description = $product->get_short_description();
}
  return $description;
}
add_shortcode('wp_woo_prod_description','wp_woo_prod_description' );

Then add this to your template [wp_woo_prod_description]

This support ticket is created 5 years, 10 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.

Our next available supporter will start replying to tickets in about 1.49 hours from now. Thank you for your understanding.

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

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 8 replies, has 2 voices.

Last updated by martinH-10 5 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1188131
Poznámka 2019-01-21 133126.jpg
Poznámka 2019-01-21 133316.jpg

Hello, I have content template made with Divi Builder for post type Product from Woocommerce.

Everything is fine, except the product excerpts. They are showing without HTML markup.

I have selected Auto-insert paragraphs but it doesnt helped.

Page is: hidden link

DiviVersion: 3.19.6

#1188157

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Martin,

Thank you for contacting our support forum.

If you were to display this section without using a divi template does it work ?

Does all the html attribute get rendered?

Please let me know.

Thanks,
Shane

#1188854

Nice idea Shane, no it does not. So it looks like divi is not the problem.

What should I try now? Disabling WP Rocket?

#1189093

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Martin,

Yes it seems that something is removing them.

Could you temporarily disable all the non-toolset plugins with the exception of divi?

This way we can atleast ensure that its not coming from another plugin then we can proceed from there.

Thanks,
Shane

#1189193
Poznámka 2019-01-22 203338.jpg

Still the same. It doesnt work. No HTML tags in excerpt. It doesnt matter if content template is made with divi.

#1189213

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Martin,

Could you provide me with a copy of the site so that I can debug this issue further for you ?

Please follow the instructions in the link below so that to create the copy for me.
https://toolset.com/faq/provide-supporters-copy-site/

Thanks,
Shane

#1189583

hidden link

#1189791

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Martin,

I found the issue. The problem is that our shortcode is using the default excerpt function which strips the excerpt of all formatting.

I wrote some custom code to get this to work for you.

Add this to your custom code in Toolset -> Settings -> Custom Code and activate it.

function wp_woo_prod_description() {
  $description = "Woocommerce is not active";
if ( class_exists( 'WooCommerce' ) ) {
	$product = wc_get_product( get_the_ID() );
	$description = $product->get_short_description();
}
  return $description;
}
add_shortcode( 'wp_woo_prod_description', 'wp_woo_prod_description' );

Then add this to your template [wp_woo_prod_description]

Thanks,
Shane

#1189854

My issue is resolved now. Thank you!