Comments (8 posts)

  1. boaxaxbo
    Posted 3 years ago #

    On my website, blog.axelboberg.se I did my own theme, but I did´nt have code for the comments. What is the most simple way to fix that I can use comments on the website?

    Thanks in advance, Axel.

  2. Michael
    Forum Moderator
    Posted 3 years ago #

    add <?php comments_template(); ?> into page.php and single.php (or into index.php if those other templates do not exist);

    also, add a comments.php into your theme;

    (at the moment, WordPress still uses the /wp-includes/theme-compat/comments.php if your theme does not have its own)

    you can use that /wp-includes/theme-compat/comments.php as an example code for your own comments.php;
    also look into comments.php of the default themes Twenty Twelve for example code - just do not copy/paste the files.

    also, check the dashboard settings under 'discussion' and for the individual posts or pages.

  3. boaxaxbo
    Posted 3 years ago #

    Thanks, but it does not work. What am I doing wrong???

  4. Michael
    Forum Moderator
    Posted 3 years ago #

    what have you done at all?

    can you post some code?

    comments will not work on index pages or archive pages - only works on single posts or static pages.

  5. boaxaxbo
    Posted 3 years ago #

    I am only using WordPress for my blog page, the homepage is not made in WordPress. In wordpress, I only got a index.php (and some css files). All the code for the blog are in that file.

    Here is the loop:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <font face="arial"> <h1><?php the_title(); ?></h1></font> <font size="1" face="times"><hr noshade color="#EEEEEE"><?php the_date(); ?> <?php the_time(); ?><hr noshade color="#EEEEEE"></font>
    <center><font face="arial"> <?php the_content(); ?>
    <hr noshade color="#EEEEEE">
    <?php comments_template(); ?>
    </center><hr noshade color="#000000"> <?php endwhile; endif; ?><p>&nbsp;</p>
  6. Michael
    Forum Moderator
    Posted 3 years ago #

    can you post a link to as single post (or a static page) with definively comments enabled -

    for instance:
    dashboard - posts - all posts - click 'quickedit' below the post title - tick 'allow comments'

    (same for pages)

    do you see the comments form in single posts or static pages, when you temporarily switch to the default theme Twenty Twelve?

  7. boaxaxbo
    Posted 3 years ago #

    Now it works fine! But can I change the design of the form? It looks not so nice...

  8. boaxaxbo
    Posted 3 years ago #

    Sorry, bad english...

Topic Closed

This topic has been closed to new replies.

About this Topic