Hi @dimdim2001
We appreciate your patience and efforts in investigating the issue.
Since the release of v9.2.0, the excerpts of our blog posts are no longer displayed correctly. Sentences are sometimes ‘merged’ with the previous ones. (e.g. no space between the sentences anymore)
To make sure we are on the same page, are you referring to content for the Products or a WordPress blog post? By default, WooCommerce shouldn’t affect your WordPress blog post.
In the v9.2.0 patchset, when rendering a block, the content is trimmed while it shouldn’t be done.
For better assistance, can you provide a video showing the issue on your end? For video, you may use https://loom.com or https://www.awesomescreenshot.com/. Please follow the instructions on that page and then paste the URL into this thread.
Looking forward to hearing from you!
Thread Starter
dimdim
(@dimdim2001)
Hi Shameem,
I was referring to the WordPress blog posts being rendered different.
I’ve recorded my findings on our beta website to not influence our production site, but the behaviour is still the same.
Thanks in advance!
Hi @dimdim2001
This kind of problem is usually caused by a conflict with your theme or with another plugin. The best way to determine this is to:
- Temporarily switch your theme to Storefront or Twenty Twenty-Four
- Disable all plugins except for WooCommerce
- Repeat the action that is causing the problem
If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated. To figure out which plugin is causing the problem, reactivate your other plugins one by one, testing after each, until you find the one causing conflict. You can find a more detailed explanation on how to do a conflict test here.
I hope that helps! Let me know once you have done a conflict test!
Thread Starter
dimdim
(@dimdim2001)
Hi Shameem,
I have disabled all other plugins and switched from theme. It seems like the trimming code I mentioned earlier conflicts with the OnePress theme.
I would like to show you how a small code change on you end could resolve the issue for us as well as for other using the OnePress theme / other affected themes.
(See my recording where I’m just moving the trimming code some lines below.)
I was even wondering why the WooCommerce plugin should trim the content when rendering blocks (‘render_block’-filter). Could you give me a valid explanation why it’s done there?
The documented summary of the ‘add_data_attributes’-method only mentions data-attributes are added for woocomerce-namespaced blocks, while it manipulates all block contents.
(The OnePress theme is applying the ‘the_content’-filter on the blog post content which is then underlying calling the wp ‘do_blocks’ method, which then applies the ‘render_block’-filter. Hence newlines are extracted from the output of the ‘do_blocks’ method resulting in the recorded UI-change.)
Looking forward to hearing from you!
Hi @dimdim2001
I was even wondering why the WooCommerce plugin should trim the content when rendering blocks (‘render_block’-filter). Could you give me a valid explanation why it’s done there?
Please note that WooCommerce blocks should not interfere with WordPress blocks. Since the issue disappeared after switching the theme, it’s confirmed that the issue is on the theme end, not WooCommerce.
This is a third-party theme, and we don’t provide help & support for 3rd-party plugins or themes as they’re outside our support scope. It would be best to reach out to the theme developer for further assistance.
Additionally, this particular forum is meant for general support with the core functionality of WooCommerce itself. For development and custom coding questions, it’s best to ask for insight related to those on either the WooCommerce Advanced Facebook group or the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question. You can also seek help from the following:
I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight/information.