Black Friday Sale! Get up to $40 off GP Premium!Learn more

My HTML Markup in Sections is disappearing!

Home Forums Support My HTML Markup in Sections is disappearing!

Viewing 15 posts - 1 through 15 (of 55 total)
  • Author
    Posts
  • #137368
    Paul

    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?

    #137408
    Tom
    Lead Developer
    Lead 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 🙂

    #137576
    Paul

    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.

    Cheers,
    Paul

    #137601
    Paul

    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?

    #137602
    Tom
    Lead Developer
    Lead 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 🙂

    #137620
    Paul

    1.2.1 as per my OP

    #137841
    Paul

    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.

    #137909
    Tom
    Lead Developer
    Lead 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 🙂

    #139894
    David

    Hey 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

    #139899
    Tom
    Lead Developer
    Lead 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: <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>

    #139901
    David

    Darn. I will have to brace myself for what is to come.

    Thanks for the input.

    #139912
    Tom
    Lead Developer
    Lead Developer

    What kind of code are you adding to the error that’s being stripped?

    #139918
    Paul

    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.

    #139964
    David

    Ironically this is what gets stripped. Generally, span tags are the issue.

    <span><!-- no one can see me --></span>

    #139978
    Tom
    Lead Developer
    Lead Developer
Viewing 15 posts - 1 through 15 (of 55 total)
  • You must be logged in to reply to this topic.