- This topic has 13 replies, 3 voices, and was last updated 1 year, 7 months ago by
Tom.
-
AuthorPosts
-
June 6, 2019 at 7:41 am #921725
Kelvin
Dear Sir/Madam,
I am not sure whether it is the issue from GeneratePress theme, I didn’t have similar issue from others
I want to add only shortcode into my page body
[mobileonly][wpv-view name="home-slider-gallery-mobile"][/mobileonly] [desktoponly][wpv-view name="home-slider-gallery"][/desktoponly]
Every time after I save the post, the code will be saved as
<p>[mobileonly]</p> [wpv-view name="home-slider-gallery-mobile"] <p>[/mobileonly] [desktoponly]</p> [wpv-view name="home-slider-gallery"] <p>[/desktoponly]</p>
The auto-paragraph tag is added automatically.
June 6, 2019 at 8:05 am #921751David
StaffCustomer SupportHi there,
AutoP is something WP does, and it can be very annoying. This article provides some code and plugin methods for stopping that:
https://wpcatalogue.com/how-to-disable-automatic-paragraph-tags-in-wordpress/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 7, 2019 at 1:41 am #922389Kelvin
Dear David,
Thanks for your information, I added the
remove_filter (‘the_content’, ‘wpautop’); remove_filter (‘the_excerpt’, ‘wpautop’);
but can only work for the classic editor but not Block editor.
Best regards,
Kelvin.
June 7, 2019 at 3:21 am #922446David
StaffCustomer SupportIn the block editor you can use the shortcode block or the Custom HTML block, they should not be affected by the AutoP
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 7, 2019 at 5:00 am #922497Kelvin
Dear David,
Thanks for your reply. How can I use the Custom HTML block, I can only find the Section but can’t Custom HTML block. (https://prnt.sc/nyv0t9)
June 7, 2019 at 5:04 am #922504David
StaffCustomer SupportSorry – the Block is only available in the Block editor which doesn’t work with GP Sections. As you’re using sections why not just use the Classic Editor on those pages?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 7, 2019 at 5:17 am #922518Kelvin
Dear David,
I don’t know how to manage the section in classic mode, I need to use the sections as full width and contained alternatively. I know HTML code.
June 7, 2019 at 5:19 am #922522David
StaffCustomer SupportThe Classic Editor plugin provides you an option in its settings to enable opening in either classic or block editor:
https://en-gb.wordpress.org/plugins/classic-editor/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 7, 2019 at 5:27 am #922526Kelvin
Dear David,
Yes, I edit the page with the classic editor (https://prnt.sc/nyve8s) but I still get the same screen (https://prnt.sc/nyv0t9). If I disable the “Use Sections” (https://prnt.sc/nyvgso), I can’t set the attribute of each section.
June 7, 2019 at 8:34 am #922763Tom
Lead DeveloperLead DeveloperAdding paragraphs is something the classic editor does, and Sections use the classic editor.
Do the
<p>
elements prevent the shortcodes from working?Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJune 7, 2019 at 8:40 pm #923070Kelvin
Dear Tom,
Sorry, I don’t understand your message. I only know every time I save the post purely with shortcodes and the <p> elements automatically be added. If I use the classic editor then I can find the attribute set for each section. If I use block editor, I can’t find the Custom HTML block but only the section.
Best regards,
Kelvin
June 8, 2019 at 9:31 am #923490Tom
Lead DeveloperLead DeveloperI only know every time I save the post purely with shortcodes and the
elements automatically be added.
Unfortunately, this is just something WordPress does in the Classic Editor as of WordPress 5.0. Before 5.0, it didn’t show the
<p>
elements even though they were there.Do those
<p>
elements prevent the shortcodes from functioning?Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJune 9, 2019 at 7:12 am #924061Kelvin
Dear Tom,
Yes, the <p> elements affect the shortcode from functioning. I have a slider made by Toolset, I add the shortcode
[mobileonly][wpv-view name="home-slider-gallery-mobile"][/mobileonly] [desktoponly][wpv-view name="home-slider-gallery"][/desktoponly]
The <p> elemenet automatically be added
<p>[mobileonly]</p> [wpv-view name="home-slider-gallery-mobile"] <p>[/mobileonly] [desktoponly]</p> [wpv-view name="home-slider-gallery"] <p>[/desktoponly]</p>
You can find the paragraph space is added (https://prnt.sc/nzki1z)
June 9, 2019 at 2:48 pm #924315Tom
Lead DeveloperLead DeveloperWhat if you add it all to one line? Here’s what I get after saving when I do that: https://www.screencast.com/t/7eacAkqwtO
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.