Support » Fixing WordPress » Commenting in the php files problem

  • Resolved skeeterz71



    I’m attempting to comment some changes I am doing in some files. For some reason the single line comment and block comments I am adding are not working. Anybody know why?

    Example 1 shows the file that I commented.

    <?php endif; ?>
    		<header class="entry-header">
    		// This is a comment
    		<?php if ( !(is_search() || is_archive() || is_category() || is_tag()) ) : // Only display Excerpts for Search ?>
    		<?php the_post_thumbnail(); ?>
    			<?php endif; ?>

    However if you view the web page here it displays
    // This is a comment

    Any help would be appreciated

Viewing 3 replies - 1 through 3 (of 3 total)
  • Where you have that comment appears to be in HTML code (not php), so you’d need to use HTML comments <!-- ...... -->

    // This is a comment

    should be

    <?php // This is a comment ?>

    Try not to turn php on and off so much, if possible. if there is a block of php code, just turn it on at start and off at the finish, makes reading code a bit easier.

    Thanks Wpyogi,

    That solved the problem. I’m new to this stuff sort of..

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Commenting in the php files problem’ is closed to new replies.