WordPress.org

Ready to get started?Download WordPress

Forums

Remove HTML tags and attributes (35 posts)

  1. esmi
    Forum Moderator
    Posted 1 year ago #

    If you want to modify the output of any part of the comment form, you can do this in your theme by creating a custom callback and calling it via comment_form().

  2. worthcommenting
    Member
    Posted 1 year ago #

    i hate to bust all ur bubbles but i don't see any of that html at all.
    i hope this is ok. this is what i have in the comment.php file

    <?php
    /**
     * @package Hey Cookie
     */
    
    // Do not delete these lines
    
    	if ( post_password_required() ) { ?>
    		<p class="nocomments"><?php _e( 'This post is password protected. Enter the password to view comments.' , 'hey-cookie' ) ?></p>
    	<?php
    		return;
    	}
    ?>
    
    <!-- You can start editing here. -->
    <?php if ( have_comments() ) : ?>
    	<h3 id="comments" class="page_title">
    		<?php comments_number( __( 'No Responses' , 'hey-cookie' ) , __( 'One Response' , 'hey-cookie' ) , '% ' . __( 'Responses' , 'hey-cookie' ) );?> <?php _e( 'to' , 'hey-cookie' ) ?> “<?php the_title(); ?>”
    	</h3>
    
    	<div class="navigation">
    		<div class="alignleft"><?php previous_comments_link() ?></div>
    		<div class="alignright"><?php next_comments_link() ?></div>
    	</div>
    
    	<ol class="commentlist">
    		<?php wp_list_comments(); ?>
    
    	<div class="navigation">
    		<div class="alignleft"><?php previous_comments_link() ?></div>
    		<div class="alignright"><?php next_comments_link() ?></div>
    	</div>
     <?php else : // this is displayed if there are no comments so far ?>
    
    	<?php if ('open' == $post->comment_status) : ?>
    		<!-- If comments are open, but there are no comments. -->
    
    	 <?php else : // comments are closed ?>
    		<!-- If comments are closed. -->
    		<p class="nocomments"><?php _e( 'Comments are closed.' , 'hey-cookie' ) ?></p>
    
    	<?php endif; ?>
    <?php endif; ?>
    
    <?php if ('open' == $post->comment_status) : ?>
    
    	<?php comment_form(); ?>
    
    <?php endif; // if you delete this the sky will fall on your head ?>

    if you guys can make sense of it....

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still - use the pastebin. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser.]

  3. esmi
    Forum Moderator
    Posted 1 year ago #

    That's because it is generated by <?php comment_form(); ?>.

  4. worthcommenting
    Member
    Posted 1 year ago #

    so ar eyou saying i can't remove it?

  5. esmi
    Forum Moderator
    Posted 1 year ago #

    No - I'm not saying that. You can modify the output of comment_form() via your theme using a custom callback. See http://codex.wordpress.org/Function_Reference/comment_form

Topic Closed

This topic has been closed to new replies.

About this Topic