Need help? Check out our Support site, then


Commenting out with HTML. How come it doesn't work?

  1. I've read about six WP help topics and third party postings on commenting out (using <!-- comment --> or something else), and I just cannot figure out what the trick is. This should be fairly simple, right? Hiding text until your ready to publish it?
    I do it in xml editors and have certainly done it outside of WP, but it's been a couple of years.

    Anyone know how to do this for the Twenty Eleven theme? I'd like to concentrate on my design right now, and hide my thoughts, so to speak.

    The blog I need help with is lantztc.com.

  2. I believe the commenting in css is done with

    /*---------your comment
    ---------------------------------*/

  3. @lantztc
    This page > Settings > Discussion
    Discussion settings is where you set up defaults for comments.
    We can also override the default settings and enable or disable future comments on any post or page.
    Depending on the theme we use when we close comments a phrase like "comments closed" or a similar phrase may appear and if so, it can only be removed by CSS editing after purchasing a custom design upgrade.

    Do you have a custom design upgrade and is this a CSS editing thread that actually belongs in the CSS Forum?

  4. You cannot comment out things at wordpress.com.

  5. Hmm looks like you can insert commented-out html in a post

    <!-- commented out text -->

    worked fine for me both in preview and when published. Just make sure you use the HTML mode to edit the comment into your post or page.

    Would it be easier to create dummy posts and simply leave the real posts as draft?

  6. Thanks for your replies. <!--comment --> doesn't work. I do have the css upgrade and I've used a bit of css to tweak my site. I'll look around for the css tool to comment out, as suggested by timethief (btw you've great advice and I've read your comments on several topics in numerous posts).

    I see dissenting opinions above. Is it true that you cannot comment out if you don't have the css upgrade, or as thesacredpath suggests, not at all?

  7. @lantztc
    I'm sorry if I confused you. thesacredpath is adept at CSS editing and knows the free themes here inside and out. He's also aadept at WordPress.org blogging as well and has clients on both. He was our most knowledgable Volunteer and he used to provide almost all support for CSS editing here at WordPress.com until just recently.

    This is notwhat he said.

    Is it true that you cannot comment out if you don't have the css upgrade, or as thesacredpath suggests, not at all?

    This is what he said:

    You cannot comment out things at wordpress.com.

  8. Thanks. For what it's worth. I've ready plenty of thesacredpath's comments, too. I agree; I've learned some great stuff from him. You're both helpful. I'll be on my way now and thanks for the information.

  9. You're welcome and best wishes.

  10. To clarify, <!--comment --> is an HTML comment and can be used in posts or pages. However, comments are stripped from the CSS editor. Comments in CSS, as grbee57 correctly mentioned, look like this: /* comments */

    Note that CSS has post revisions with all of your past code, so if you remove something, you can find it again using the revisions which are listed at the bottom right of the Appearance → Custom Design → CSS page.

    I wouldn't be opposed to trying to bring comments back for the CSS editor at some point. It's rarely mentioned though. @lantztc, what's your opinion, are comments a necessary part of writing CSS in your eyes?

  11. @designsimply,
    <!--comment --> works in HTML inside WP? Really? Great news. Perhaps I need to try it again. I'm not sure why I couldn't get it to work.

    /*comments*/ for css would be a nice feature so I could remind myself where the code I nab came from and to what it applies. For example, I could write in my stylesheet: /*This is from xyz website and controls the top menu*/

    Thanks for asking, but I can certainly plod along w/o css commenting enabled, too.

  12. <!--comment --> works in HTML inside WP? Really? Great news. Perhaps I need to try it again. I'm not sure why I couldn't get it to work.

    Note that HTML can be added like this: http://en.support.wordpress.com/editors/#html-editor

    You can't add HTML to the Appearance → Custom Design → CSS page (and it seemed like you might have been trying to do that, but I'm not 100% sure). HTML comments won't work on the Appearance → Custom Design → CSS page.

    Thanks for the feedback about CSS comments! Much appreciated, and I'm keeping it in mind for future feature updates.

  13. Right. I understand the purpose of the HTML editor, and that <!--comment--> is not used in css.

    Btw, do you have a favorite resource (hard copy book or otherwise) for brushing up on css? I'd like detailed how-to and overview information. I see quite a few out there, and of course I can always Google search for specific fixes, but I'd want a more holistic user guide, of sorts.

    I've some pesky issues that I'm pretty sure I can resolve on my own, but I need a tad bit more fundamental knowledge. I thought I'd ask since you since I checked out designsimply.com, and you've proclaimed, "CSS is a pretty completely awesome tool, and I love it." I also perused your CrackerJack slides. Nice! Thanks.

  14. strike the first "since" from the entry above. Yikes!

  15. Btw, do you have a favorite resource (hard copy book or otherwise) for brushing up on css?

    I like this book: http://www.cssmastery.com/

    And this site: http://www.htmldog.com/guides/

    This site has some cool "try it yourself" spaces that are great for learning/testing: http://www.w3schools.com/cssref/tryit.asp?filename=trycss_background-color

    And you should definitely check out the browser tools for whichever browser you use. For example Firebug is an add-on for Firefox, but Chrome and Safari have tools like it built in. They are invaluable for testing CSS live.

  16. Thanks for checking out the Crackerjack CSS slides. :) I need to come up with more clever titles like that one... !

Topic Closed

This topic has been closed to new replies.

About this Topic