Show Atahualpa Comment

WordPress themes, including Atahualpa, typically show only a text link in the post footer that the user must click to enter a comment.  This does not encourage immediate user comment entry after viewing the post.

The comment entry screen can be displayed after a post if the the WordPress comments-template is invoked in the Loop.  The comments-template file references a PHP variable $withcomments which if true will cause the comment form to be displayed.


index.php

Replace the Atahualpa index.php with the following:

<?php 	/* get all options: */
include (TEMPLATEPATH . '/functions/bfa_get_options.php');
get_header(); ?>

<?php $withcomments = 1 ;  /* Required for the comment entry screen */ ?>

<?php /* If there are any posts: */
if (have_posts()) : $bfa_ata['postcount'] == 0; /* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>

	<?php /* This outputs the next/previous post or page navigation.
	This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
	bfa_center_content($bfa_ata['content_above_loop']); ?>

	<?php /* The LOOP starts here. Do this for all posts: */
	while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>

		<?php /* Add Odd or Even post class so post containers can get alternating CSS style (optional) */
		$odd_or_even = (($bfa_ata['postcount'] % 2) ? 'odd-post' : 'even-post' ); ?> 

		<?php /* This is the actual WordPress LOOP.
		The output can be edited at Atahualpa Theme Options -> Style & edit the Center column */
		bfa_center_content($bfa_ata['content_inside_loop']); ?>

                <?php /* Show the comment entry screen on blog posts */
		if (is_home()) comments_template(); ?>

	<?php /* END of the LOOP */
	endwhile; ?>

	<?php /* This outputs the next/previous post or page navigation and the comment template.
	This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
	bfa_center_content($bfa_ata['content_below_loop']); ?>

<?php /* END of: If there are any posts */
else : /* If there are no posts: */ ?>

<?php /* This outputs the "Not Found" content, if neither posts, pages nor attachments are available for the requested page.
This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
bfa_center_content($bfa_ata['content_not_found']); ?>

<?php endif; /* END of: If there are no posts */ ?>

<?php bfa_center_content($bfa_ata['center_content_bottom']); ?>

<?php get_footer(); ?>


The comment form is shown for full posts and for excerpts on the home page. If the comment form should not show when posts are excerpts then the function bfa_post_bodycopy() in bfa_post_parts.php must be modified.

bfa_post_parts.php

function bfa_post_bodycopy($before = '<div class="post-bodycopy clearfix">', $after = '</div>') {

	global $bfa_ata, $post, $withcomments;

	echo $before;
	if ( (is_home() AND $bfa_ata['excerpts_home'] == "Full Posts") OR
	(is_category() AND $bfa_ata['excerpts_category'] == "Full Posts") OR
	(is_date() AND $bfa_ata['excerpts_archive'] == "Full Posts") OR
	(is_tag() AND $bfa_ata['excerpts_tag'] == "Full Posts") OR
	(is_search() AND $bfa_ata['excerpts_search'] == "Full Posts") OR
	(is_author() AND $bfa_ata['excerpts_author'] == "Full Posts") OR
	is_single() OR is_page() OR
	(is_home() AND !is_paged() AND $bfa_ata['postcount'] <= $bfa_ata['full_posts_homepage']) ) {
		$withcomments = 1 ;
		$bfa_ata_more_tag_final = str_replace("%post-title%", the_title('', '', false), $bfa_ata['more_tag']);
		the_content($bfa_ata_more_tag_final);
	} else {
		$withcomments = 0 ;
		the_excerpt();
	}
	echo $after;
}


As of the time of this post, a typing error in the function bfa_post_headline() in bfa_post_parts.php should be corrected.  This error will lead to incorrect post title display.

function bfa_post_headline($before = '<div class="post-headline">', $after = '</div>') {

	global $bfa_ata, $post;

	if ( is_single() OR is_page() ) {
		$bfa_ata_body_title = get_post_meta($post->ID, 'bfa_ata_body_title', true);
		$bfa_ata_display_body_title = get_post_meta($post->ID, 'bfa_ata_display_body_title', true);
	} else {
		$bfa_ata_body_title_multi = get_post_meta($post->ID, 'bfa_ata_body_title_multi', true);
	}

	if ( (!is_single() AND !is_page()) OR $bfa_ata_display_body_title == '' ) {

		echo $before; ?>
		<h<?php echo $bfa_ata['h_posttitle']; ?>><?php 

		if( !is_single() AND !is_page() ) { ?>

			<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php
		} 

		if ( (is_single() OR is_page()) AND $bfa_ata_body_title != "" ) {
			echo htmlentities($bfa_ata_body_title,ENT_QUOTES,'UTF-8');
		} else {
			if ( $bfa_ata_body_title_multi != '' ) echo htmlentities($bfa_ata_body_title_multi,ENT_QUOTES,'UTF-8');
			else the_title();
		}

		if ( !is_single() AND !is_page() ) { ?></a><?php } ?></h<?php echo $bfa_ata['h_posttitle']; ?>>
		<?php echo $after;
	}
}