• I can’t link to a page because the site is not publicly visible at this point.

    I have just one page that has a ton of divs and nested divs and I’m trying to keep them straight. I put in a bunch of comments in Text view to help myself keep track of it all, and when I went to Visual view, they were all visible on the page. Going back to Text view I see they’ve been converted to & l t ;––” and “––& g t ;”. (Had to add spaces because in this post they appear as they should.)

    Am I doing something wrong? Is there a better way for me to utilize code comments?

    <!–– open sponsor-left ––>

    • This topic was modified 5 years, 5 months ago by DebT.
    • This topic was modified 5 years, 5 months ago by DebT.
    • This topic was modified 5 years, 5 months ago by DebT.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Felipe Santos

    (@foosantos)

    Hi there,

    You need to create an HTML block, and then put your comments.

    
    <!-- wp:html -->
    <!-- Test --!>
    <!-- /wp:html -->
    
    • This reply was modified 5 years, 5 months ago by Felipe Santos.
    Thread Starter DebT

    (@debbiet)

    Thank you — I don’t understand. Where do I put that? Around each comment? The second line you have with Test, would that be the comment?

    Moderator Felipe Santos

    (@foosantos)

    Yes, Gutenberg uses comments to set blocks, so just create an HTML block and put your comment on it. ??

    Thread Starter DebT

    (@debbiet)

    OK, I just tried that for one comment.

    Going into Visual view, it still shows & l t ; !–– open sponsor-left –– & g t ; Going back to Text view it has again converted the brackets to character codes, plus now has also added paragraph tags. I see though that it has not converted the wp:html brackets you recommended.

    Any ideas? I’m using the Classic Editor if that makes a difference.

    • This reply was modified 5 years, 5 months ago by DebT.
    Moderator Felipe Santos

    (@foosantos)

    Yes, that makes a lot of difference. ?? hehe

    You can’t put comments on WordPress Visual Classic Editor.

    You have 3 options here:

    – Change your editor to “Text” and put your comments.
    – Deactivate classic editor at all, and use Gutenberg.
    – Use a plugin that allows you to do it.

    Thread Starter DebT

    (@debbiet)

    Wow, okay, thank you so much. Been putting off using Gutenberg but maybe the time has come. ??

    Moderator Felipe Santos

    (@foosantos)

    Great. Just try it out again! ??

    If you activate block editor, so you can just put it the way a sent you before:

    <!-- wp:html -->
    <!-- your comment here --!>
    <!-- /wp:html -->
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘HTML comments being converted to HTML character codes’ is closed to new replies.