Support » Fixing WordPress » HTML Comments (not post comments) in pages & posts fail.

  • I searched through the forums for something about this, but only found a thread that was abandoned 4 months ago, and which seemed to consist mostly of heated/spiteful discussion when it was going, but no solution.

    I’m converting a static HTML site to WordPress. One page on the site is commonly updated, cyclically, in a systematic way. The easiest way I’ve found to do this is with HTML comments (“< ! – -” and “- – >”, without the spaces). Unfortunately, when I pasted my code into a WP Page (via the HTML editor, not Visual editor), I found that the HTML close-comment string was changed to “–>” (that’s “& # 8211 ;>” without any spaces). Since character entity 8211 is not the same as a double-dash, my comments aren’t successfully closed out, and havoc is wreaked on the rest of the page (oddly, the comments do close at points, but not where they’re supposed to, and not with the normal “- – >” string. I’m not sure how that works, but it’s some XHTML quirk, I guess).

    I can work around this problem with a bunch of unpublished pages that I copy/paste text from, but that’s not really an optimal solution (using three or four pages for the content of one page). A proper bug fix would be preferable.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Having the same problem. I want to have html comments hidden in a post, but the comments appear in the content.

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    Other than using a the css for display:none, I can’t think of how to do that. The post parser does seem to eat those comments.

    <!-- Hidden! -->

    Ran into the same issue. I’d love to see a plugin developed for commented code and/or notes associated with each page/post. The closest I’ve come to finding one is Kahis’s WP-Notes plugin.

    I’ve started to use the “Custom Fields” area for storing un-used code. It’s a total hack but it’s worked for what I need.

    Hope this helps.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘HTML Comments (not post comments) in pages & posts fail.’ is closed to new replies.