Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Comments, trackbacks & pings (http://forum.bytesforall.com/forumdisplay.php?f=19)
-   -   Displaying comments and comment form below each post on multi post pages, in 3.4.x (http://forum.bytesforall.com/showthread.php?t=2423)

Flynn Jul 13, 2009 05:21 PM

Displaying comments and comment form below each post on multi post pages, in 3.4.x
 
Showing comments and comment form below each post on multi post pages, too:
For Atahualpa 3.4.2+ (This may be an option in later versions)

1. Edit Atahualpa's index.php add the green part:

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


2. At Style & Edit CENTER COLUMN -> The LOOP, add the green part

<?php $withcomments = 1; comments_template(); ?>
</div><!-- / Post -->


3. At Style & Edit CENTER COLUMN -> Below the LOOP, remove this:

<?php /* Load Comments template (on single post pages, and static pages, if set on options page): */
bfa_get_comments(); ?>


noyell Jul 14, 2009 03:24 PM

i got this to work.. but it is displaying multiple comments per post... where can i set this to just grab a single comment for each post when its on multipost pages?

upscho Aug 4, 2009 02:46 PM

Is there a way to use this also with Atahualpa 3.3.3? Or does it only work with 3.4.2?

Best regards,
upscho

Flynn Aug 8, 2009 05:55 AM

The LOOP is not editable in 3.3.3

artc1209 Jun 30, 2010 08:47 AM

Flynn,

Would you explain how to just list existing comments under the post, but omit the empty Comment template, please? (I figure the users can click Leave Comment if they want...)

Thanks,
Art

Ilke Aug 12, 2010 05:42 AM

Hi Flynn,

I actually have the same question. Displaying the comments and comment form works fine when I follow your instructions, but I really don't want the comment form to show automatically too. Any solution?

Thanks a lot in advance,
Ilke

dextor Dec 30, 2010 11:49 AM

Hi Flynn,

I am also very much interested in a solution that displays the comments to posts, but omits the comment form!

Best whishes from Berlin...Atahualpa rules!

dextor

juggledad Dec 31, 2010 06:25 AM

if you shut off comments for a post, the form won't show for that post, just the existing comments.

dextor Jan 1, 2011 09:27 AM

yeah, totally correct.

but that would not allow any new comments to be submitted...or am I on the wrong track?

I would like to show the comment form only on a single post page, where the user gets directed through towards the comment-link in the post footer. On the other hand the comment form should
also show up on category-pages that have only one post as content...

I am thinking about using something like this to determine the number of posts

global $wp_query;
$num = $wp_query->post_count;

and then maybe set the single_post flag?

What do you think?

Best wishes

dextor

dextor Jan 2, 2011 05:34 AM

Happy New Year BFA-Team!

I don't know why I had so much problems with this, but here is the (kinda easy) solution that I found wich suits my needs:

(i) index.php

Insert Flynn's code

(ii) The LOOP:

In here, I insert this stuff to decide whether or not I want to see the post-footer. If the footer shows up, I also include the comments_template call that Flynn showed.

(Note: post_is_in_descendant_category('35') is a function that I included into wp-includes/functions.php)

Code:

<?php
/* Show the footer only in project-posts or work-sample pages */
if ( post_is_in_descendant_category('35') OR in_category( array('56', '58') ) ) {
       
        bfa_post_footer('<div class="post-footer">','</div>');


        /**
        * Load Comments template:
        *
        * -> always show existing comments also if it is a multi-post page
        * -> show the comment form only on single pages or category pages with only one post and open comments
        **/
        $withcomments = 1; comments_template();


        /* If the footer is displayed, close with a dotted line and padding to the bottom */
        ?> <div class="comments-footer-byline"></div>

<?php } else {
        /* Show the footer byline instead */
        ?>  <div class="post-footer"></div> <?php } ?>
</div><!-- / Post -->


(iii) comments.php

Insert this stuff to show the form only on single post pages (could this maybe become a feature in future releases???)

Code:

<?php               
if ( is_single() ) {
/* show comment form only, if it is a single page  */
?>
       
<!-- Comment Form -->
<div id="respond">


Thanks for your support!

Best wishes

dextor

sf410745 Mar 23, 2011 08:01 PM

Thanks Flynn.

But I have another problem,was I want my blog's comments only exist in single post page, how could I do?

Thanks a lot.

Judy

sf410745 Mar 24, 2011 07:52 AM

Quote:

Originally Posted by STB (Post 61425)
That is how it works by default. Nothing you have to do normally.

Can you define your problem?


I didn't define it surely. My problem is after I adjust my blog, the comment area exist in homepage and single post, how could I make it only exist in single post?

cssbook May 28, 2011 07:27 PM

Yes I did it this way and succeeded! Can also be done with css
Thanks Flynn
__________________
شات الشله


All times are GMT -6. The time now is 08:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.