Comments on home page

Community Forums Forums General Discussion Comments on home page

This topic is: not resolved

This topic contains 7 replies, has 4 voices, and was last updated by  WatersWard 9 months, 3 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #38738

    minimalblogger
    Participant
    Post count: 2

    I’m trying to add comments to the homepage of the Fabric theme. Based on a search of these forums, I added the following code to functions.php:

    add_action( ‘genesis_after_loop’, ‘genesis_comments’ );

    Visually, it doesn’t seem to be doing anything. Upon inspecting the code, I find this at the bottom of the post:

    <div id=”comments”>
    </div>

    But that div is empty (that’s a direct cut & paste; not edited). I initially thought that maybe the post data didn’t exist (since it’s happening *outside* the loop), and changed

    genesis_after_loop

    to

    genesis_after_content

    but that doesn’t seem to have helped either.

    Any idea what I’m doing wrong?

     

    http://recoveringshopaholic.com/
    #38739

    braddalton
    Participant
    Post count: 7467

    Where exactly do you want to display the comments based on this visual hook guide? http://genesistutorials.com/visual-hook-guide/

    Rather than edit the home.php file, you could use a custom function or create a widget area in the hook position you want to output the comments. You can then use the recent comments widget which is a default WordPress widget.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #38744

    minimalblogger
    Participant
    Post count: 2

    That’s an awesome page! I’d like the comments to show up somewhere in the

    genesis_after_post_content

    genesis_after_post

    sections. Basically exactly where they show up in any other post that’s *not* a homepage post. And to clarify, I need the comments from the post itself – not the most recent comments across all posts.

    In short, I just need

    http://recoveringshopaholic.com/

    to look exactly like

    http://recoveringshopaholic.com/project-333-week-four/

    I would cheerfully use a custom function, but what’s got me confused is that this *should* be possible with a simple line of code like the one I already tried. I just need to tell Genesis to do whatever it normally does with comments, only do it on the homepage too.

    I keep thinking that this shouldn’t be this hard. :)

    #38745

    braddalton
    Participant
    Post count: 7467

    There’s no home.php in your theme so you need to use a custom function.

    I’ll test the function for you first.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #38882

    minimalblogger
    Participant
    Post count: 2

    Brad, thanks for any help you can give! A custom function would definitely work; I just have no idea how to even pull that off – I’ve been trying to hack away at things in functions.php and modify hooks, etc. but I’ve had *zero* luck.

    With that comments div being empty, I get the feeling that somewhere comments are supposed to be loaded by a query, but they’re not. That’s what’s got me really confused. I think if that riddle could be solved, I’d be okay.

    Anybody have any thoughts on that?

    #38889

    braddalton
    Participant
    Post count: 7467

    Hi

    I did find some code which i tested for several hours but just couldn’t get it to work. I’ll keep trying and hope someone else can jump in with the solution. Thanks for being patient.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #44369

    bcoco
    Participant
    Post count: 11

    This one is stumping me, too. Anyone get this to work? (Seems like such a simple thing – have a post with comments on the front page. Y’know?)

    #48689

    WatersWard
    Participant
    Post count: 2

    Stumping me too. Just keeping this post going in the hope that someone finds a solution…

    Doug Ward

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.