Forums

[resolved] Adding Comments to Page (21 posts)

  1. frogdogz
    Member
    Posted 11 months ago #

    Hello all, I'm hoping someone can help me with a theme issue I am having, since the template creator seems to no longer be offering any support.

    I am using a WP theme which by default does not have comments appear on pages, even when 'comments allowed' is chosen as an option site wide. Digging into the templates, it seems comments are not included on the page layout.

    Using 20-20, I can see the code that creates the comments on the bottom of a page, but I can't figure out what I need to do/edit to make comments automatically appear on a page, with the appropriate page url named.

    If, for example, I embedded this code on the page template --

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Any comments added to any page on the site would post to the url named in this code.

    So, what I'm looking for is the default code which adds comments to the page on which the comment code appears.

    I hope that explanation makes sense :)

    The site in question is actually this one:

    http://frenchbulldogvillage.net

  2. tsany
    Member
    Posted 11 months ago #

    try use pastebin :) ur code is not showing

  3. frogdogz
    Member
    Posted 11 months ago #

    darn it, I thought I did... let me edit it.

  4. frogdogz
    Member
    Posted 11 months ago #

    [Code moderated as per the Forum Rules. This is your final warning...]

  5. tsany
    Member
    Posted 11 months ago #

    basically u want comments like

    http://frenchbulldogvillage.net/2011/06/emee-ive-been-adopted/

    appear in

    `http://frenchbulldogvillage.net/adopt-a-frenchie/currently-available-frenchies/'

    is it ?

  6. frogdogz
    Member
    Posted 11 months ago #

    Yes, exactly - but comments specific to each page.

    Sheesh, I hope I sussed out pasting the code this time... I was using the code mark up function, but I guess that's no longer allowed?

  7. tsany
    Member
    Posted 11 months ago #

    so what do u want is something like..

    i want comments in page 1 and 2 but not page 3 and 4 ?

    if so.. find in the page.php

    < ?php comments_template( '', true ); ?>

    or if it doesn't exists.. it's fine lol

    change it to

    < ?php if ( is_page( array( ID#, ID#, ID# ) ) ) comments_template( '', true ); ?>

    ID# is your Page ID.
    `

  8. dbphte1
    Member
    Posted 11 months ago #

    does the theme have a comments.php file? (if thats a daft questionn, please excuse:))

  9. tsany
    Member
    Posted 11 months ago #

    how should i know if the theme has it ? you're the one who have it.. lol

  10. dbphte1
    Member
    Posted 11 months ago #

    im not the one with the problem:P

  11. tsany
    Member
    Posted 11 months ago #

    ah yes.. it's depends on the theme creator.. it may or may not.

  12. frogdogz
    Member
    Posted 11 months ago #

    Aha! Yes, it does have a comments.php file

    Let me go see if adding that to the page template does the trick.

  13. esmi
    Theme Diva & Forum Moderator
    Posted 11 months ago #

    @dbphte1: Try looking for a comments.php file in Appearance ->Editor. Just ensure that your current theme is selected in the dropdown when you check the list of files.

  14. frogdogz
    Member
    Posted 11 months ago #

    Nope, adding the comments code from comments.php made pages throw this error --

    Parse error: syntax error, unexpected T_ENDWHILE in /home/fbv2011admin/frenchbulldogvillage.net/wp-content/themes/child_care_creative/layout_single_page.php on line 82

  15. dbphte1
    Member
    Posted 11 months ago #

    should probably take it out then...

    i might be way off being a total newbie - but if the theme creator disabled comments you just steal the comments.php from another theme and use that?

  16. esmi
    Theme Diva & Forum Moderator
    Posted 11 months ago #

    No. You can't just drop the comment code from one theme straight into another.

  17. frogdogz
    Member
    Posted 11 months ago #

    This is the current page layout php file:

    http://pastebin.com/zcUvYb29

    [Code moderated as per the Forum Rules. Please use the pastebin]

  18. frogdogz
    Member
    Posted 11 months ago #

    And here's the comments.php file --

    http://pastebin.com/KGZV6j5G

  19. tsany
    Member
    Posted 11 months ago #

    add < ?php comments_template( '', true ); ?>

    on your page.php between

    <?php endwhile; endif; ?>

    and

    <?php if($sidebar_position != 'none'

    hope it helps

  20. frogdogz
    Member
    Posted 11 months ago #

    Unfortunately, adding that does not seem to be working. See:

    http://frenchbulldogvillage.net/adopt-a-frenchie/currently-available-frenchies/dexter/

    I'll look and see if I've added it correctly....

  21. frogdogz
    Member
    Posted 11 months ago #

    OK, this seems to have done it:

    <?php if(comments_open(get_the_ID())){ ?>
                            <p>&nbsp;</p>
                            <?php
                            comments_template();
                            ?>
                        <?php } ?>

    I lifted the comment tag from within the blog post template, and added it as you noted above.

    THANK YOU!

    I seriously appreciate everyone's help with this. :)

Reply

You must log in to post.

About this Topic