• Resolved fatenwp

    (@fatenwp)


    hi
    I am trying to create new theme from scratch (learning) , using some videos on the internet
    https://blog.epicerastudio.com/2010/06/the-top-five-places-to-learn-wordpress/
    I am on day 8 . there are two things , comments are not saved in the DB and when I click submit it takes me to posts’ page .
    please help

    <?php if($comments) :?>
    <ol id='comment_section'>
    	<?php foreach($comments as $comment):?>
    	<li id="comment-<?php comment_ID();?>">
    		<?php if($comment->comment_approved='0') :?>
    			<p>Your comment is undergoing moderation.</p>
    		<?php endif;?>
    		<?php comment_text();?>
    		<p><?php comment_author_link();?> on <?php comment_date();?></p>
    	</li>
    	<?php endforeach;?>
    </ol>
    <?php else:?>
    <p>Be the first to comment!</p>
    <?php endif;?>
    <?php if(comments_open()):?>
    	<?php if(get_option('comment_registration') && !$user_ID) :?>
    		<p>You must be logged in to commit on this article.</p>
    	<?php else:?>
    	<form action="<?php echo get_option('siteurl');?>"/wp-comments-post.php" method="post" id="commentform">
    		<?php if($user_ID):?>
    		<p>Logged is as <a href="<?php echo get_option('siteurl');?>/wp-admin/profile.php"><?php echo $user_identity;?></a></p>
    		<?php else: ?>
    			<p><input type='text' name='author' id='author' value="<?php echo $comment_author;?>"/>
    				<label for='author'>Name</label></p>
    			<p><input type='text' name='email' id='email' value="<?php echo $comment_author_email;?>"/>
    				<label for='email'>Mail <?php if($req) echo '(Required field)';?></label> </p>
    			<p><input type='text' name='url' id='url' value="<?php echo $comment_author_url;?>"/>
    				<label for='url'>Website </label></p>
    		<p>
    		<?php endif;?>
    		<textarea name='comment' id='comment' cols='50' rows='10'></textarea>
    		</p>
    		<p><input type='submit' name='submit' id='submit' value='Submit'/></p>
    		<input type='hidden' name='comment_post_ID' value="<?php echo $id;?>"/>
    		<?php do_action('comment_form',$post->ID);?>
    		</form>
    	<?php endif;?>
    <?php else:?>
    		<p>Comments are currently closed</p>
    <?php endif; ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘comments not saved DB’ is closed to new replies.