- This topic has 54 replies, 9 voices, and was last updated 1 year, 9 months ago by Tom.
September 16, 2015 at 6:09 pm #137368Paul
My custom HTML markup in Sections (text tab) disappears every time I save. Div tags seem to remain, but P and BR do not, and closing Span tags disappear when they’re used to close multiple paragraphs of content.
Disabling autop in functions.php, nor the Always Edit in HTML plugin, seem to help either.
Ideally, I really like to shut the Visual editor off completely so that I can code completely in HTML and have all the code remain after a save.
I am using GeneratePress v 1.3.12 with GP Premium v 1.2.1 on WordPress 4.3.1
Any ideas?September 17, 2015 at 12:33 am #137408TomLead DeveloperLead Developer
The WordPress editor tries to be smart, but it can definitely be a pain.
It will strip empty tags, so if you have an empty span or HTML tag, it’s best to add an HTML comment within it, like this:
<div class="empty-div"><!-- comment in an empty div --></div>
Works the same for span tags etc.. It just tricks WP into thinking there’s content in there, but it won’t display anything.
You can always turn off the visual editor by going to “Users > Your Profile” – there’s an option in there to disable it.
Let me know 🙂September 17, 2015 at 1:31 pm #137576Paul
Thanks for the tip about adding comment in empty DIVs. I’ll see if that also resolves the issue of the disappearing closed </span> tags across multiple paragraphs — I think the reason I used <span> as such a workaround was because of the disappearing markup problems I was having. Ideally, I’d stick with valid markup though.
PaulSeptember 17, 2015 at 3:03 pm #137601Paul
Houston, we have a problem.
I’ve Disabled the Visual editor, but now I cannot close open sections nor open closed sections, nor can I paste into open sections other than the one I was previously working in.
Is this a bug?September 17, 2015 at 3:16 pm #137602TomLead DeveloperLead Developer
What version of GP Premium/Sections are you using?
I just recently tested it out using no Visual Editor to make sure everything was working perfectly.
Let me know 🙂September 17, 2015 at 8:01 pm #137620Paul
1.2.1 as per my OPSeptember 18, 2015 at 11:25 am #137841Paul
If the extra info helps, I did try logging out of WordPress after disabling Visual editor, and then stopped and re-started WAMP (I am building on localhost), logged back in to my WP Dashboard, and tried editing a page that had sections. While the Visual editor WAS disabled, I still could not open or close different sections in the page, nor could I drag and drop their ordering. I did note that deleting sections was possible. Editing within the open active section was possible.
My installation says I’m using GeneratePress Version: 1.3.12 along with GP Premium Version 1.2.1. Updates for the AddOns are enabled.
Thanks Tom.September 18, 2015 at 11:29 pm #137909TomLead DeveloperLead Developer
Sorry for not getting back to you – totally thought I replied last night.
GP Premium 1.2.1 is quite old – we’re on 1.2.71.
Can you download the latest version from your account?: https://generatepress.com/account
1. Delete the current version
2. Upload and activate the new version
That should fix it.
Let me know 🙂September 26, 2015 at 9:31 am #139894David
I am curious if there is a solution. I have GP Version: 1.3.14. And I have this same issue. It’s cool for me to Disable the visual editor when writing. But the client has several writers for the site. And they will be using the Visual Editor most of the time. I tested this several times and html code disappears.
And I also want to use your other plugin Lightweight Grid Columns. So I’ll be switching back and forth between the editors.
Can you make a recommendation?
ThanksSeptember 26, 2015 at 10:02 am #139899TomLead DeveloperLead Developer
Unfortunately this is a TinyMCE issue (the editor WP uses), which is kind of out of my control.
In my experience, the only code that is stripped is empty element tags.
For example, this will be stripped:
But this won’t:
If you need the empty element, put an HTML comment in there to “trick” the editor:
<span><!-- no one can see me --></span>September 26, 2015 at 10:18 am #139901David
Darn. I will have to brace myself for what is to come.
Thanks for the input.September 26, 2015 at 12:07 pm #139912TomLead DeveloperLead DeveloperSeptember 26, 2015 at 12:47 pm #139918Paul
Will do. Thanks, Tom. I didn’t realize I had to go to that link to update my GP Add-ons. I thought the upgrades were handled within the PlugIns section in the WP Dashboard the same way all my other ones are.September 26, 2015 at 8:22 pm #139964David
Ironically this is what gets stripped. Generally, span tags are the issue.
<span><!-- no one can see me --></span>September 26, 2015 at 10:13 pm #139978
- You must be logged in to reply to this topic.