WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Comments problem - not working - can you look? (13 posts)

  1. kingofmycastle
    Member
    Posted 9 years ago #

    Hi! I have been creating a WP blog which can be seen at http://www.KingOfMyCastle.com - The whole site existed before apart from the blog page. I used my original html/css and just added in the PHP to create the WordPress loop, and categories etc. This all seems to work fine.

    Unfortunatly I can't seem to get the comments to work. Clicking on the 'comments ?' link just brings the post back up. I have this in my index.php: <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
    and I have the files comments.php and comments-popup.php in my root directory (which have not been altered).

    All I want is the ability for people to leave some comments on my site. Can anyone tell me where I'm going wrong? I'm using WordPress 1.5.1.3. Thanks in advance!

    John King

  2. Ryan Duff
    Member
    Posted 9 years ago #

    You don't have the comment form in your code for the single post. When you click on the comments link it takes you to the #comments anchor on the page, but you don't have the code there to display the form. You need to edit your template.

  3. kingofmycastle
    Member
    Posted 9 years ago #

    Thanks for your reply. I'm a bit new to all of this so could you explain this to me a bit more?

    Are you suggesting I add something to my index.php file? Or do you mean I need to mess around with another file?

    If I add some kind of comments anchor on my index.php page will it not appear everytime I go directly to the home page?

    Thank you.

    John King.

  4. Ryan Duff
    Member
    Posted 9 years ago #

  5. kingofmycastle
    Member
    Posted 9 years ago #

    Update:

    Hi! I saw some help at the wiki here: http://wiki.wordpress.org/?pagename=comments_popup_script

    I added this to my index.php:
    <?php comments_popup_script(400,500,'file'); ?>

    Now when you click on comments a box comes up (which is something) but alas the box is empty (404). Can you tell me what file I am missing?

    Thank you.

    John King

  6. kingofmycastle
    Member
    Posted 9 years ago #

    I've taken that line out now as it totally messed up my style-sheet in my Firefox broswer. :(

  7. kingofmycastle
    Member
    Posted 9 years ago #

    I've been looking at that codex page for a week now but unfortunatly it describes everything in what I call a 'meta language'. Do you know of a more plain english description of how to include comments on my site.

    Thanks again!

    John King..

  8. moshu
    Member
    Posted 9 years ago #

    Here is a "plain" visual aid about how templates and themes work...

  9. kingofmycastle
    Member
    Posted 9 years ago #

    Thanks, that does help a bit.

    Is part of my problem that I have created my own index.php which I have put in the root directory? (I just added the php stuff such as the wordpress loop into my html and added a php statement at the first line). I'm not actually using a theme from the wp-content/theme directory.

    When I click on the comments link it just takes me to: http://www.kingofmycastle.com/?p=10#comments
    is this correct? It just seems to call the index.php with that post, and does nothing to call up a comments page.

    Thanks.

    John King..

  10. moshu
    Member
    Posted 9 years ago #

    If you are using WP.1.5 or later don't mess around with other solutions because WP is looking for everything in the /themes/yourtheme/ directory.
    Just place your index.php and your stylesheet (named style.css) in a directory under themes and your life will become easier :)
    Explanation: if you don't have all the template files in your own mytheme folder, WP will looking for the mising ones (like comments etc.) in the Default theme and will "borrow" them from there.

  11. kingofmycastle
    Member
    Posted 9 years ago #

    Thanks Moshu, that makes total sense. Obviously WP uses a database and I'd better keep to the format of putting my files into the correct folder if I expect it work. I'll post what happens here.

    Thanks!!

    John King..

  12. moshu
    Member
    Posted 9 years ago #

    If you move your theme into its own folder, don't forget to edit the top section of your style.css file:
    http://codex.wordpress.org/Theme_Development#Theme_Style_Sheet

  13. kingofmycastle
    Member
    Posted 9 years ago #

    Thanks Moshu, I've moved the files into a new themes directory and got it looking just as before. I had to add some stuff to link to the stylesheet but it all made sense.

    I now see exactly what I have to do. By looking at the existing themes I can see how I can crib all the code from them and add them to my index.php (or other php) files. I'm sure I'll be able to get the comments working in no time.

    But not on a Saturday night ;)

    You've been really helpful and I appreciate it. Cheers!!!

    John King..

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags