Community Forums › Forums › Archived Forums › Design Tips and Tricks › Help please: Displaying comments on blog page
Tagged: displaying comments on main blog page, php
- This topic has 9 replies, 3 voices, and was last updated 11 years, 5 months ago by Trisha.
-
AuthorPosts
-
June 26, 2013 at 11:03 am #47809June 26, 2013 at 6:57 pm #47912AnitaCKeymaster
Read this and see if it helps - http://wordpress.org/support/topic/show-comments-on-homepage-posts-without-showing-comment-form.
Need help with customization or troubleshooting? Reach out to me.
June 27, 2013 at 4:01 am #47986TrishaMemberThanks Anita,
I definitely think that post put me in the right direction (since it led me to viewing the code for single.php).
The solution to get the comments to display is a ridiculously simple line of code (which took me over 10 hours worth of playing around before I eventually stopped being prideful and asked for help).
<?php function be_show_comments() { global $withcomments; $withcomments = 1; comments_template( ' ', true ); } ?>
I simply needed to add the arguments to the call to comments_template.
Note: for the purposes of this site I do want to keep the comment form.
I tweet as @trishawebs
“Make New Mistakes. Make glorious, amazing mistakes. Make mistakes nobody’s ever made before.” ~ Neil Gaiman
June 27, 2013 at 5:55 am #47993AnitaCKeymasterWell, don't wait so long next time! We are here to help you. I hope it works for you.
Need help with customization or troubleshooting? Reach out to me.
June 27, 2013 at 5:58 am #47994AnitaCKeymasterI think this might help you. You need a conditional statement that tells the code to NOT show up on the home page - http://wpspeak.com/remove-comments-section-genesis-framework/.
Need help with customization or troubleshooting? Reach out to me.
June 27, 2013 at 6:33 am #48004TrishaMemberI won't wait next time 🙂
With the way that the site has been configured (the home-page is a separate page that does not allow comments) so that it does not seem to be necessary, why do you think I need that?
(Bearing in mind the blog home page is the guest book) ~ I ask to learn, not to argue.
I tweet as @trishawebs
“Make New Mistakes. Make glorious, amazing mistakes. Make mistakes nobody’s ever made before.” ~ Neil Gaiman
June 27, 2013 at 6:55 am #48007AnitaCKeymasterSo in your Genesis > Theme Settings - do you have the box checked for Comments on Pages or unchecked? Also on that individual page - is the Comment for Pages uncheck?
Need help with customization or troubleshooting? Reach out to me.
June 27, 2013 at 12:38 pm #48081TrishaMemberGenesis > Theme Settings – Comments on Pages unchecked &
Individual pages > Comments unchecked.Comments are only allowed on the blog page which is the guestbook.
I tweet as @trishawebs
“Make New Mistakes. Make glorious, amazing mistakes. Make mistakes nobody’s ever made before.” ~ Neil Gaiman
July 1, 2013 at 9:48 am #48687WatersWardMemberI think this solution applies to me, but I can't figure out how to get it working. I have my blog set as the home page. I am only pulling 1 post and I want to display comments for that post. Will the function that Trisha posted above work? Where do I put that function?
Thanks,
Doug Ward
July 1, 2013 at 11:22 am #48704TrishaMemberHi Doug,
It should work for you.
You need to include it in your functions.php file.
Firstly you will need a function in your functions file to initialize subsequent functions. In this case my function looked like this:
<?php add_action(‘genesis_setup’,'child_theme_setup’,15); function child_theme_setup() { //extract from function child_theme_setup //Show comment form on posts without having to click through add_filter (‘genesis_after_post_content’, ‘be_show_comment_form’); } ?>
Secondly, you need to create your be_show_comment_form function, which is the one that looks like:
<?php function be_show_comments() { global $withcomments; $withcomments = 1; comments_template( ' ', true ); } ?>
I hope this helps, Doug post the URL when you are looking for some help - it may make easier for us to help you.
Kind regards,
I tweet as @trishawebs
“Make New Mistakes. Make glorious, amazing mistakes. Make mistakes nobody’s ever made before.” ~ Neil Gaiman
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.