• Resolved WorldBuilder

    (@worldbuilder)


    Hi all,

    To be brief, I installed WP to make announcements on a site I’m building for friends. We don’t want comments, so I disallowed them. I also hacked some php code to eliminate even the mention of comments. In particular, I like this: http://www.chrisbartlett.net/bi3/news/?p=8

    Then a few months went by and I ended up installing a second WP so they could make separate announcements. I’ve been able to duplicate everything I did on the first one except the comments on the single post page(s) See this: http://www.chrisbartlett.net/bi3/workshops/?p=5

    What it all boils down to is that I want the second page to look like the first. What am I forgetting?!

    Thanks!

    Chris

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter WorldBuilder

    (@worldbuilder)

    Any ideas? Is it merely a setting I am missing in the admin console or is it some snippet of code I am supposed to remove? Thanks!

    Both.

    You can disable comments in general (for the whole blog) and on a post by post basis.

    You should remove from the index the comment link
    and from the single the call for the comments template.

    (if you go by the second solution, don’t bother with the first one)

    Thread Starter WorldBuilder

    (@worldbuilder)

    Thanks for the reply!

    Well, regarding the index, I think you mean NOT seeing anything about comments on the main page, such as this: http://www.chrisbartlett.net/bi3/workshops/

    Right? If that’s what you mean, as you can see it’s already done.

    But regarding the single page (and the php file that controls it), I know not if I will screw anything up by simply deleting code. Could you be more specific as to what code to remove?

    The reason I ask is because when I look at the two single.php files I have (one for NEWS and one for WORKSHOPS), they are identical (as far as I can see. But there must be a code difference, eh?

    Thanks!

    Chris

    1. You cannot have 2 single.php files in a theme. the file, as its name suggests – controls the display of a single post.
    2. Pages on the other hand are displayed by the page.php (by default) or any other Page template you might have.
    3. The line calling for the comments template is:
    <?php comments_template(); // Get wp-comments.php template ?> – and will show the form + any comments made.
    4. The code displaying the Comments link [like “Comments (6)] is this:
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?> (or something similar, the text might differ)

    Thread Starter WorldBuilder

    (@worldbuilder)

    Thanks you very Moshu. I will look into this tonight and hopefully can work it out based on your advice. I will let you know with a post!

    Thread Starter WorldBuilder

    (@worldbuilder)

    Hello again!

    About not having two single.php files in a theme, I don’t have that. I have two entirely separate installations of WP. Obviously, each one has the same “theme”, based on my CSS.

    But as you can see in my original post, the “single” pages of each individual blog is different, which is what I don’t understand. I just looked at both single.php files and they are identical in every way, line for line. So I don’t see how the code of the file itself could be the problem.

    The workshops single post page at http://www.chrisbartlett.net/bi3/workshops/?p=5 says “You can leave a response, or trackback from your own site.” It also has the form where someone can leave a comment. I want all that gone.

    The News single post page at http://www.chrisbartlett.net/bi3/news/?p=8 says “Both comments and pings are currently closed.” It does not have that comment form, but rather text that simply says “Comments are closed.”

    That is exactly how I would like the Workshops single post page to appear. And it seems to me that the php code generates the page content dependent on settings from the admin console.

    But I’ve looked over both of those and unless I’m missing something, they are identical, too!

    Bottom line is that on the Workshops single post page, I want it to say exactly the same thing as the News single post page does.

    How can I do that? Thanks!

    Have to quote myself:

    You can disable comments in general (for the whole blog) and on a post by post basis.

    So, do it.
    Remember: disabling the comments/pings on your blog is NOT retroactive – it applies only to future posts. Posts made BEFORE the settings were changed to not allow comments will still display the comment form etc. You have to edit them one by one and change those options… under Discussion in the right side of the Write subpanel.

    Thread Starter WorldBuilder

    (@worldbuilder)

    Hi Moshu,

    Well, I already did disable comments before I ever posted this question. But what I did not know, and thanks for telling me, was that disabling was not retroactive. Thanks!

    Learn somethin’ new every day!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Eliminate comments on single post page?’ is closed to new replies.