• Hi,

    I am trying to leave comments on specific pages through wordpress with this function : comments_template().

    I downloaded this plugin Exec-PHP that allows me to insert PHP code into a page (through my wordpress admin)

    On one of these pages, I determine with PHP, the display of multiple elements.

    My goal is to condition the display of comments ( comments_template(), or if any of you know another function, plugin…) on my page (created with wordpress admin)

    I tried to insert into my code, through the admin, the function comments_template() but I had sooo many errors in return

    I guess it s because i didnt include the folder managing this function, but i dont know how to include it and I don’t know the folder which contain the function.

    Is this the correct format to include ?
    <?php include( TEMPLATEPATH . ‘/nomfichier.php’ ); ?>

    To sum up I am struggling between my template source folder and wordpress admin…

    Any help would be greatly appreciated!!!!

    Thank youuuuuu

Viewing 3 replies - 1 through 3 (of 3 total)
  • hi kairi084,

    comments_template() is added in the theme folder.. not admin.

    I would think that the easiest way of working with php and pages to avoid issues, is to make a page template which has the code you need to use (In which case using template tags works fine) and then assign that template to the page from the editor

    Thread Starter kairi084

    (@kairi084)

    hi,

    first thank you for the answer.

    to answer magickman5 =)
    I try to insert comments_template() in the folder of my template (in page.php because I want to post comments in a page not an article)
    but the result it’s : that I have comments in all my pages !!!
    And I don’t want =(
    I created one page thank to the admin, which condition the display of lots of things..so how can I do to display comments when I want in my code?

    For RVoodoo =)
    thanks too for your answer. but concretly I want to keep all the fonctionalities of comments_template()and display comments when I want

    so how can I do ? You advise me to make a page template but what code I have to introduce in?

    Thanks you very much =))

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to include comments’ is closed to new replies.