Forums

Custom theme - comments not displayed (5 posts)

  1. jknetdesign
    Member
    Posted 1 year ago #

    I'm building a custom themed blog site content management system. I designed the site in Dreamweaver CS4 and am in the process of converting the files to WordPress. The Home Page does not require comments, but the Latest Page does. I added the latest_post.php and enabled comments. The comments are nowhere in sight.
    PLEASE HELP!

  2. Rahul Sonar
    Member
    Posted 1 year ago #

    1) if it is a page, and you have selected default page template, you need to add comment support in page.php

    <?php comments_template(); ?>

    2) If you are using a custom page template (you need to select this when you are editing the page..), you need to add comment support code in your page template as mentioned above. In your case, that page seems to be latest_post.php

  3. jknetdesign
    Member
    Posted 1 year ago #

    I designed the page originally as latest_post.html
    Then saved it as latest_post.php
    with this code in the top of the file

    <?php /* Template Name: Latest Post
    */ ?>

    Uploaded the file, then in the dashboard I added the page
    and selected Latest Post as the default template.

    Can you simplify the steps for me of what I need to do?
    You said first I add <?php comments_template(); ?> to page.php?
    Where exactly in the code does it go?

    I'm not quite sure what you mean by: 2) If you are using a custom page template (you need to select this when you are editing the page..), you need to add comment support code in your page template as mentioned above. In your case, that page seems to be latest_post.php

    Very appreciative of your help.

  4. Rahul Sonar
    Member
    Posted 1 year ago #

    2) If you are using a custom page template (you need to select this when you are editing the page..), you need to add comment support code in your page template as mentioned above. In your case, that page seems to be latest_post.php

    exactly what you are doing right now....

    Now, in latest_post.php, you need to add comments_template(), below the content portion.. you can refere post.php for example..

  5. jknetdesign
    Member
    Posted 1 year ago #

    It worked!
    I put that php tag inside a div tag so I can position it anywhere and
    use my background color!

    Question: I have a multiple page blog.
    Each page is a different topic, of course.
    On the Latest Post page I'd like it to display only one post
    and that one post needs to be the most recent post that somebody commented on, from any page.

Topic Closed

This topic has been closed to new replies.

About this Topic