Question: comments.php

Ads

 
 
 

Share on Google+Share on Google+

Anoop K S
comments.php
0 Answer(s)      7 years ago
Posted in : Java Beginners
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/

// Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');

if ( post_password_required() ) { ?>
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
<?php
return;
}
?>

<!-- You can start editing here. -->
<?php if ( comments_open() ) : ?>

<div id="respond">
<h3>Ajouter un Commentaire</h3>
<div class="cancel-comment-reply">
<small><?php cancel_comment_reply_link(); ?></small>
</div>

<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
You must be <a href="<?php echo wp_login_url( get_permalink() ); ?>">logged in</a> to post a comment.
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<textarea name="comment" id="comment" cols="58" rows="10" tabindex="4" ></textarea>
<?php if ( is_user_logged_in() ) : ?>
Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a>
<?php else : ?>
<input type="text" name="author" id="author" value="<?php if(esc_attr($comment_author) != '') { echo esc_attr($comment_author); } else { echo "Name"; } ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> onclick="if(this.value=='Name') { this.value = ''}" />
<input type="text" name="email" id="email" value="<?php if(esc_attr($comment_author_email) != '') { echo esc_attr($comment_author_email); } else { echo "Email"; } ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> onclick="if(this.value=='Email') { this.value = ''}" />
<?php endif; ?>
<input name="submit" type="image" id="submit" tabindex="5" value="Post Comment" src="<?php bloginfo('template_url'); ?>/images/button.png" width="5" height="18"/>
<?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; // If registration required and not logged in ?>
</div>

<?php if ( have_comments() ) : ?>
<h3><?php comments_number('Comments', 'Comments', 'Commentaires' );?></h3>

<?php $i = 0; ?>
<?php foreach ($comments as $comment) : ?>
<div id="comment-<?php comment_ID(); ?>" class="comment" <?php if($i > 0) { echo " style='border-top: 1px solid #2B2B2B;'"; } ?>>
<div class="comment-author vcard">
<?php echo get_avatar($comment, $size='64'); ?>
</div>
<div class="comment-meta">
<b><?php comment_author(); ?></b> <span><?php echo get_relative_time('comment');?></span>
<?php comment_text() ?>
</div>
<div class="clear"></div>
</div>
<?php $i++; ?>
<?php endforeach; ?>


<?php else : // this is displayed if there are no comments so far ?>

<?php if ( comments_open() ) : ?>
<!-- If comments are open, but there are no comments. -->

<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>

<?php endif; ?>
<?php endif; ?>
<?php endif; // if you delete this the sky will fall on your head ?>
Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
comments.php - Java Beginners
comments.php   This post is password protected. Enter the password to view comments. Ajouter un Commentaire You must be logged in to post a comment. Logged in as . Log out
Tutorials   
Java Spring Hibernate Struts Training What is the meaning of Java Platform? Why Java is a platform independent language? What is the benefits of learning Core Java? Which technology should I learn after Java? What is array in java with example? How to Convert ArrayList to Array? How to substring in Java? How to format number in Java? What is instance variable in Java? How to download MySQL JDBC driver? What is Calendar class in Java? Which is the best Java tutorials for beginners? How to rename a file in Java? How to delete file in Java code? How to get day from date in Java using Calendar? How to get day of week in Java? How to calculate Date Difference in Java? How to compare date in Java? How to declare array in Java? How to calculate average of array in Java? What is Array in Java? write a java program to find the summation of all the integers entered on command line Sum of two numbers using command line arguments in Java How to create and use Array in Java? How to pass command line arguments in Java? How to create Applet Hello World? Appending String efficiently in Java How to append String in Java? How to list even numbers between 1 and 100? How to add BigDecimal in Java? What is Abstraction In Java? Which is best Beginners Java Tutorial? What is java.util package? Create list from array in Java Filter collection in Java 8 What is the best way to filter a Java Collection? Easy way to transform Collection to Array? How to convert Collection to Array in Java? What are Basic Java Language Elements? Advanced Java Tutorials in 2017 Java brief history Best Reasons to learn Java Java Example Codes and Tutorials in 2017 How do I read a large file quickly in Java? Is learning Java worthwhile? How to create first Java Program? Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly?

Ads

 
Advertisement null

Ads