• Resolved DesDeuts

    (@desdeuts)


    Hello everyone. I am new to self hosted blogs, only put my new site up in the last week, though I’ve had a few ordinary WordPress sites before.

    Info: bravenewworld.com.au, I am running the Blaskan theme, hosted through Panthur if it makes a difference

    All was ok until I noticed the comment box appearing on my home page – a static page. I edited the comments.php (through instructions found on a wordpress forum) to remove the comment box and the text underneath from pages, however I believe I have taken out the ability to have comments on posts too* 😐
    (*rookie)

    I need to enable comments to appear on posts only – without all that ‘you can use html code blah blah’ at the bottom of the comments box. I just want it to say ‘Leave a comment’ and then have the comment box there for them to use, and previous comments to appear underneath.

    If anyone can help – this is the current code that is filed under the comment.php now:

    <section id="comments">
    	<?php if ( post_password_required() ) : ?>
    		<p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'blaskan' ); ?></p>
    		</section>
    		<!-- /#comments -->
    		<?php return; ?>
    	<?php endif; ?>
    
    	<?php if ( have_comments() ) : ?>
    		<h1 id="comments-title"><?php printf( _n( __( 'One comment', 'blaskan' ), __( '%1$s comments', 'blaskan' ), get_comments_number(), 'blaskan' ), number_format_i18n( get_comments_number() ) ); ?></h1>
    
    		<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
    			<nav class="post-nav" role="navigation">
    				<div class="previous"><?php previous_comments_link( __( '<span class="meta-nav">←</span> Older Comments', 'blaskan' ) ); ?></div>
    				<div class="next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">→</span>', 'blaskan' ) ); ?></div>
    			</nav>
    			<!-- / .post-nav -->
    		<?php endif; ?>
    
    		<ol id="comment-list"><?php wp_list_comments( array( 'callback' => 'blaskan_comment' ) ); ?></ol>
    
    		<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
    			<footer>
    				<nav class="post-nav" role="navigation">
    					<div class="previous"><?php previous_comments_link( __( '<span class="meta-nav">←</span> Older Comments', 'blaskan' ) ); ?></div>
    					<div class="next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">→</span>', 'blaskan' ) ); ?></div>
    				</nav>
    				<!-- / .post-nav -->
    			</footer>
    		<?php endif; ?>
    	<?php else : ?>
    		<?php if ( ! comments_open() && ! is_page() ) : ?>
    			<p class="nocomments"><?php _e( 'Comments are closed.', 'blaskan' ); ?></p>
    		<?php endif;?>
    
    	<?php endif; // end have_comments() ?>
    
    	<?php
    	$commentform = array(
    		'fields' => apply_filters( 'comment_form_default_fields',
    
    		array(
    			'author' => '<label for="comment-author">' . __( 'Name', 'blaskan' ) .
          ( $req ? ' <span class="required">' . __( '(required)', 'blaskan' ) . '</span>' : '' ) .
    			'</label> ' .
          '<input id="comment-author" name="author" type="text" value="' .
          esc_attr( $commenter['comment_author'] ) . '" size="30"'.
    			( $req ? ' aria-required="true"' : '' ) .
    			'>',
    
    			'email' => '<label for="comment-email">' . __( 'Email', 'blaskan' ) .
    			( $req ? ' <span class="required">' . __( '(required - will be kept a secret)', 'blaskan' ) . '</span>' : '' ) .
    			'</label> ' .
          '<input id="comment-email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"'.
    			( $req ? ' aria-required="true"' : '' ) .
    			'>',
    
    			'url' => '<label for="comment-url">' . __( 'Website', 'blaskan' ) . '</label>' .
           '<input id="comment-url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30">' ) ),
    
    			'comment_field' => '<label for="comment">' . __( 'Comment', 'blaskan' ) . '</label>' .
          '<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>',
    
    			'must_log_in' => '<p class="must-log-in">' .  sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.', 'blaskan' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( get_the_ID() ) ) ) ) . '</p>',
    
    			'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'You are logged in as <a href="%s">%s</a>. <a href="%s" title="Log out of this account">Log out?</a></p>', 'blaskan' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( get_the_ID() ) ) ) ),
    
    			'comment_notes_before' => null,
    
    			'comment_notes_after' => null,
    
    			'id_form' => 'commentform',
    
    			'id_submit' => 'submit',
    
    			'title_reply' => __( 'Post a comment', 'blaskan' ),
    
    			'title_reply_to' => __( 'Leave a Reply to %s', 'blaskan' ),
    
    			'cancel_reply_link' => __( 'Cancel reply', 'blaskan' ),
    
    			'label_submit' => __( 'Post comment', 'blaskan' ),
    	);
    
    	comment_form( $commentform );
    	?>
    
    </section>
    <!-- / #comments -->

    BTW I hope that I have used the code entering button correctly, excuse me if it hasn’t worked properly – I have seen how people don’t like lots of code on forum pages so am *trying* to do the right thing 🙂 [If I haven’t let me know how please.]

    Any help would be greatly appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • WPyogi

    (@wpyogi)

    Did you try turning off the comments on the individual pages – on the pages screen click on quick edit for any page you want to change – then you’ll see a box for “allow comments” – unclick it.

    Thread Starter DesDeuts

    (@desdeuts)

    Hi WPyogi (great name)
    I have those settings: on pages I have unchecked the Allow comments box and on posts I have checked Allow comments.
    I have realised that my settings are fine, it is the way my page is set up – it pastes the post in full instead of summaries as I’ve had on previous themes – so I was looking for the comment box on the blog page instead of within the actual post page if that makes sense.

    Being a WPyogi, do you happen to know how I might be able to change these settings? I’ve just looked through all my options and can’t seem to find it. Or if it is in fact a limitation of my theme?

    I know this might be wondering off the original topic but it is just as vital to know. Any help again would be appreciated.

    WPyogi

    (@wpyogi)

    I think what you want is possible with just using the per page/post settings – I tried it on a test site and I think that’s what I got. I turned off comments on the home page, but enabled them on some posts… But just to be sure, on the blog page (of several posts), it doesn’t show the comments box – you have to click on the post to go to the posts page to see the comments/add new comments – is that what you mean?

    I think that’s pretty usual, but it’s probably modifiable, though I’m not sure how to do that (I’m really not that much of a code-level yogi 🙂 ).

    Thread Starter DesDeuts

    (@desdeuts)

    Thanks for your help 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Comments on Blaskan Theme – please help’ is closed to new replies.