Add comments to the end of posts on main page
-
In order to do this, you’ll need to modify the template, so you’ll need to make a child theme. http://codex.wordpress.org/Child_Themes
Once you have your child theme in place, have a look at the content.php file.
Make a duplicate and insert in your child them.
Then take line 16 – 22 out and paste them in between the 2 endif on line 57, 58.So look for this:
<?php endif; // End if $tags_list ?> <?php endif; // End if 'post' == get_post_type() ?>
and change it to:
<?php endif; // End if $tags_list ?> <?php if ( comments_open() || ( '0' != get_comments_number() && ! comments_open() ) ) : ?> <span class="sep"> | </span> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'mon_cahier' ), __( '1 Comment', 'mon_cahier' ), __( '% Comments', 'mon_cahier' ) ); ?></span> <?php endif; ?> <?php endif; // End if 'post' == get_post_type() ?>
Don’t forget to make a child theme though. If you simply make a change to the parent, if and when there’s a release your changes will get overwritten.
That worked a treat – thank you very much (and thank you for creating the great theme)!
I just tried doing this in my child theme and nothing is changing. Here’s what I’m looking at in the child theme’s style.css.
<?php endif; // End if $tags_list ?><?php if ( comments_open() || ( ‘0’ != get_comments_number() && ! comments_open() ) ) : ?>
<span class=”sep”> | </span>
<span class=”comments-link”><?php comments_popup_link( __( ‘Leave a comment’, ‘mon_cahier’ ), __( ‘1 Comment’, ‘mon_cahier’ ), __( ‘% Comments’, ‘mon_cahier’ ) ); ?></span>
<?php endif; ?>
<?php endif; // End if ‘post’ == get_post_type() ?>
That code is in
content.php
, notstyle.css
.@carriecolemanphotography – you cannot put PHP in a CSS file – it doesn’t work there :). So take all that out – or it will likely cause CSS problems.
Reread Christine’s post above – looks like she’s talking about changing the
content.php
file – in a copy you’ve moved to the child theme.If you need additional help, it’s best to start a new thread – as this one is already marked resolved – you can do so here:
- The topic ‘Add comments to the end of posts on main page’ is closed to new replies.
(@kerrylambeth)
11 years, 2 months ago
I’d like the option to leave a comment to appear after a post, rather than at the top under the headline as it is currently. Does anyone know where and how to change this?
The site I’m working with is http://www.planestrainsandplantagenets.com/