Skip to content
Browse files

Custom closed comment message

  • Loading branch information...
1 parent 0059317 commit 5a3964ca57af688307a8896f06306cf80fc2b3bf @fikrirasyid committed Oct 10, 2011
Showing with 29 additions and 8 deletions.
  1. +16 −7 comments.php
  2. +6 −1 css/main.css
  3. +7 −0 options.php
View
23 comments.php
@@ -25,7 +25,7 @@
</div><!-- .comment-nav -->
<?php endif; ?>
- <ol id="comment-list">
+ <ol id="comment-list" class="clearfix">
<?php wp_list_comments(array('callback' => 'tp_comment')); ?>
</ol>
@@ -41,11 +41,20 @@
<?php endif; ?>
<?php
- /* If the comment section is closed, show this message instead */
+ /* If there's no comment yet, show this message instead */
elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
- <h4 class="comment-title">
- <?php _e('Comment is closed', 'thoughtplifier'); ?>
+ <h4 class="section-title">
+ <?php _e('No Response Yet', 'thoughtplifier'); ?>
</h4>
- <?php endif; ?>
-
- <?php comment_form(); ?>
+ <p id="noresponse-message"><?php _e('There is no response for this thought.', 'thoughtplifier'); ?></p>
+ <?php
+ endif;
+ if (!comments_open()) : /* Show this message is the comment is already closed*/
+ ?>
+ <div id="comment-closed-message">
+ <h4 class="section-title">The comment is closed</h4>
+ <p><?php echo of_get_option('tp_closed_comment_message', 'Sorry but we have decided to close the comment section for this post.'); ?></p>
+ </div>
+ <?php
+ endif;
+ comment_form(); ?>
View
7 css/main.css
@@ -189,7 +189,6 @@ body {line-height: 1; font-family: Georgia, Helvetica, Arial; font-size:14px;
.comment-nav.bottom {margin:50px 0 0;}
.comment-nav a {float:left; padding:5px 10px; border-bottom:1px dotted #afafaf; font-weight:bold; font-style:italic;}
.comment-next a {float:right;}
-#comment-list {background:#999;}
#comment-list li {margin:0 0 10px; float:left; width:480px;}
#comment-list li:after {content:".";display:block; height:0; clear:both; visibility:hidden;}
.comment-avatar {float:left; padding:4px; border:1px solid #cfcfcf; background:#fff; margin:0 20px 20px 0;}
@@ -219,6 +218,7 @@ body {line-height: 1; font-family: Georgia, Helvetica, Arial; font-size:14px;
.comment-title,
#reply-title {font-size:25px; text-align:center; margin:30px 0 50px 0; line-height:1.5; text-transform:uppercase; letter-spacing:1px; color:#000; text-shadow:0 -1px 0 #fff;
letter-spacing:-0.5px;}
+#comment-wrap .section-title {margin-top:20px;}
#cancel-comment-reply-link {display:block; font-size:12px; letter-spacing:0;}
.form-allowed-tags,
@@ -233,6 +233,11 @@ body {line-height: 1; font-family: Georgia, Helvetica, Arial; font-size:14px;
#url {border:1px solid #afafaf; padding:8px 10px; font:italic 12px Georgia, Serif; height:16px; width:458px; color:#555;}
#comment {border:1px solid #afafaf; padding:8px 10px; font:italic 12px Georgia, Serif; height:150px; width:458px; color:#555;}
.form-allowed-tags {display:block; margin:20px 0;}
+#noresponse-message {text-align:center; font:16px Georgia;}
+
+#comment-closed-message {border:1px solid #B52F40; background:#FCBAC3; margin:25px 0 0 0; padding:0 20px 10px; text-align:center; color:#333; text-shadow:0 1px 0 #efefef;}
+#comment-closed-message a {border-bottom:1px solid #B52F40; font: bold 14px Georgia; padding:0 3px;}
+#comment-closed-message a:hover {background:#FCD6DB;}
/* Pagenavi */
#pagenavi {float:left; width:500px; margin:0 10px 30px 10px;}
View
7 options.php
@@ -169,6 +169,13 @@ function optionsframework_options() {
"std" => "",
"type" => "textarea");
+ $options[] = array( "name" => "Custom message for closed comment form",
+ "desc" => "Type custom message for closed comment form here.",
+ "id" => "tp_closed_comment_message",
+ "std" => "Sorry but we have decided to close the comment section for this post.",
+ "type" => "textarea");
+
+
$options[] = array( "name" => "Ads",
"type" => "heading");

0 comments on commit 5a3964c

Please sign in to comment.
Something went wrong with that request. Please try again.