• I was wondering if anyone knew a way to simply comment out code so I don’t have to delete it entirely if I want to have the features in the template later on.

    For example, there are a number of features on my template sidebar that I don’t want in this first launch, but I might want back again. I backed up the sidebar.php file, and then cut out the code for the unwanted features. But if there’s a way that I could signify the unwanted code as being a comment for the program to ignore, that would simplify things. I tried putting /* */ tags in, but that didn’t seem to work. The symbols just showed up on the sidebar.

    Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Use <?php /* and */ ?> instead. The /* */ comments only work when they are inside PHP blocks, not in the HTML sections.

    If you want the code to remain on the webpage but just not display, then <!-- and --> will work. This will make it still there and still sent to the browser, but the browser will ignore it. The PHP comments will make it not sent to the browser at all.

    Thread Starter brian-in-nj

    (@brian-in-nj)

    Thanks Otto. That looks like it iwll work. Just out of curiousity, is it better for search engine results to use the latter, i.e., <! … –> pair?

    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Commnet out Code?’ is closed to new replies.