WordPress.org

Ready to get started?Download WordPress

Forums

Making notes in code (4 posts)

  1. daveconrey
    Member
    Posted 7 years ago #

    Sorry if this topic has been discussed, but I've been searching for almost an hour now and can't find the answer. I'm adding some analytics script to my file, but I want to notate it to remind myself what that script is if I go back into the file later and change it.

    First, I've been placing the code between the HEAD tags of my Header file. Should I be placing it in a different file?

    Second, I've tried adding the /* */ tags to make the text non viewable, but it still shows up at the top. Is there a better way/place to make these notes?

  2. moshu
    Member
    Posted 7 years ago #

    Your comments in a html file should be:
    <!-- my code starts here -->
    qwerty qwerty asdfg asdfg
    <!-- my code ends here -->

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    That will work, but another way is like so:
    <?php // this is a comment ?>
    <?php /* this is a comment too */ ?>

    The difference is that moshu's way will have the comment in the actual source code of the page and anybody can see it. The php way above gets ignored during page processing, and will not show up in the final page, but will still be in the theme itself.

  4. daveconrey
    Member
    Posted 7 years ago #

    thanks guys. I appreciate that tidy bit of info.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags