Tagged: ,

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #28466

    Hi,

    I’m not so familiar with PHP, could anyone help me please with the right PHP syntax?

    The original code in the comments.php is this:

    if(comments_open()){

    echo "<div class='comment_container ".avia_layout_class('entry',false)." units $indent'>";

    echo "<h3 class='miniheading'>".__('Ihr Gästebucheintrag','avia_framework')."</h3>";

    echo "<span class='minitext'>".__('Ich freue mich auf Ihr Feedback!','avia_framework')."</span>";

    comment_form();

    echo "</div>";

    }

    and this single line

    comment_form();

    should be replaced by this code:

    <?php

    $comments_args = array(

    'title_reply'=>'Add your guestbook entry',

    'label_submit'=>'Send your guestbook entry',

    'comment_field' => '<p class="comment-form-comment"><label for="comment">Your message</label>
    <textarea id="comment" name="comment"></textarea></p>'

    );

    comment_form($comments_args);?>

    but it doesn’t work because of the <?php – how can I write this in the right PHP way?

    Thanks.

    #137618

    Remove the opening and closing php tags from your code and then replace it. Eg:

    if(comments_open()){
    echo "<div class='comment_container ".avia_layout_class('entry',false)." units $indent'>";
    echo "<h3 class='miniheading'>".__('Ihr Gästebucheintrag','avia_framework')."</h3>";
    echo "<span class='minitext'>".__('Ich freue mich auf Ihr Feedback!','avia_framework')."</span>";

    $comments_args = array(
    'title_reply'=>'Add your guestbook entry',
    'label_submit'=>'Send your guestbook entry',
    'comment_field' => '<p class="comment-form-comment"><label for="comment">Your message</label>
    <textarea id="comment" name="comment"></textarea></p>'
    );
    comment_form($comments_args);

    echo "</div>";
    }

    Regards,

    Devin

    #137619

    works fine, thanks a lot for your help!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Tweaking the comments.php: could anyone help please with the right PHP syntax?’ is closed to new replies.