• Resolved joelongstreet

    (@joelongstreet)


    I’m trying to display my comments on the first page of my blog. There should be one post, and all the comments. I can’t figure out why this isn’t working. index.php and single.php are exactly the same but single is displaying the post and index isn’t. What am I overlooking here?

    Thanks for any help,

    Joe

Viewing 7 replies - 1 through 7 (of 7 total)
  • Are they the same on front end or the actual code ?

    Thread Starter joelongstreet

    (@joelongstreet)

    actual code

    did you checked the general Settings -> Reading to see if index displays posts ?

    Joe, this is happening because of these lines in wp-includes\comment-template.php:


    if ( ! (is_single() || is_page() || $withcomments) )
    return;

    They’re in the function comments_template. The source code comments for that function give the explanation.

    To get the effect you want, replace the first of those two lines to


    if ( ! (is_single() || is_page() || $withcomments) || is_home() )

    Of course, it’s desirable to avoid hacks. If I can find a plug-in toaccomplish this , I’ll try to remember to post a link to it here.

    Joe, this is happening because of these lines in wp-includes\comment-template.php:

    if ( ! (is_single() || is_page() || $withcomments) )
       return;

    They’re in the function comments_template. The source code comments for that function give the explanation.

    To get the effect you want, replace the first of those two lines to

    if ( ! (is_single() || is_page() || $withcomments) || is_home() )

    Of course, it’s desirable to avoid hacks. If I can find a plug-in toaccomplish this , I’ll try to remember to post a link to it here.

    Thread Starter joelongstreet

    (@joelongstreet)

    NICE! Exactly what I was hoping to accomplish. Thanks for your help,

    Joe

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Comments – First Page’ is closed to new replies.