- This topic has 54 replies, 9 voices, and was last updated 4 years, 10 months ago by Tom.
-
AuthorPosts
-
September 16, 2015 at 6:09 pm #137368Paul
Hey Tom,
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 DeveloperThe 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 #137576PaulThanks 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.
Cheers,
PaulSeptember 17, 2015 at 3:03 pm #137601PaulHouston, 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 DeveloperWhat 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 #137620Paul1.2.1 as per my OP
September 18, 2015 at 11:25 am #137841PaulIf 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 DeveloperSorry 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 versionThat should fix it.
Let me know π
September 26, 2015 at 9:31 am #139894DavidHey Tom,
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?
Thanks
September 26, 2015 at 10:02 am #139899TomLead DeveloperLead DeveloperUnfortunately 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:
<span></span>
But this won’t:
<span>text</span>
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 #139901DavidDarn. I will have to brace myself for what is to come.
Thanks for the input.
September 26, 2015 at 12:07 pm #139912TomLead DeveloperLead DeveloperWhat kind of code are you adding to the error that’s being stripped?
September 26, 2015 at 12:47 pm #139918PaulWill 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 #139964DavidIronically 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 #139978TomLead DeveloperLead DeveloperWhat if you give it a class?
-
AuthorPosts
- You must be logged in to reply to this topic.