When you’re working with web sites everything is written in code. The 2 most popular code types are HTML and PHP. But with all that code, pages and pages of it, you need ot be able to find specific code. This is where “markup” or “comments” come into play. Technically, “Mark Up” is the structure of a document while “comments” is like leaving yourself a note. In this article I’m going to use the 2 words interchangeably, though technically different. This article is going to show you how to use HTML mark up (comments) and PHP mark up (comments).
Don’t be afraid of leaving mark up. The more the better.
HTML stands for Hypertext MarkUp Language. HTML mark up looks like this:
<!– Your comment goes here –>
Anything you put between the dashes goes into the comment.
I tru to make sure and include an identifier to tell me what specifically I was thinking or doing. Here is an example of HTML mark up I prefer to use:
<!– search box starts here –>
code goes here
<!– search box stops here –>
PHP stands for Hypertext Preprocessor. Yeah, I know… the acronym doesn’t really make sense. Anyway… PHP markup looks different than html markup. PHP mark up has 2 different appearances:
The first type is simply 2 forward slashes “//”. Use 2 forward slashes infront of any 1 line of text. As long as you dont use the return key (carriage return), you can keep typing and this will work. If you use a return key, simply use another 2 forward slashes at the beginning of the line.
// this comment would not be shown because of the double forward slash at the beginning.
// this also would
// not show.
The second type uses a forward slash then an astrick “/*” at the beginning of the text and then an astrick forward slash at the end “*/”. You can easily use this to span multiple paragraphs. But when you use this type you will remove any code within the markup brackets.
/* wow… I must have something really
long to say or tell
because I’ve used this markup.
Markup is great. Markup helps you know what the code is SUPPOSE to do. Markup also helps you find code later on when you need to make changes or updates.
As a note, WordPress in the past has been finicky about including mark up on the page or post editor. sometimes it will remove the markup. This shouldn’t be a problem any longer, but it is something to watch out for. This is an issue with every WYSIWYG editor available today, so please don’t blame WordPress.
I hope this little markup lesson helps in your web efforts. If you have thoughts on markup, or even if you use the info on this page, please say so in the comments.