Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #15703

    Hi,

    I would like to give the opportunity for visitors to be able to comment on some of my articles on pages – however, even with comments swirched on it is not showing. I figure this must have something to do with the nature of the dynamic templates. Is there a way I can have comments enabled on pages and be able to enable and disable them at will for pages?

    Thanks

    Vince

    #88688

    Hi,

    Open page.php and find this code.

    $avia_config['size'] = 'page';
    get_template_part( 'includes/loop', 'page' );

    Below that, put this one.

    //wordpress function that loads the comments template "comments.php"
    comments_template( '/includes/comments.php');

    Cheers,

    Ismael

    #88689

    Hi Ismael, unfortuantely that did not work so I roleld it back. I think it may have something to do with the custom page templates that are built from Avia system.

    #88690

    Hi!

    Yes, dynamic templates don’t support comments because of technical reasons. Thus you can’t use dynamic templates if you want to show comments for posts and/or pages.

    Best regards,

    Peter

    #88691

    Hi Peter,

    Thanks for the reply. Shouldnt this be written into this theme as an integral and important part of the the theme. After all, commenting on ‘Pages’ as well as post is at the heart of the WordPress philosophy?

    Thanks

    Vince

    #88692

    Sure but unfortunately we need to accept that there’re technical limits and Kriesi encountered various issues when he tried to add comments to dynamic templates. If he finds a solution he’ll certainly implement this feature…

    #88693

    Hello – I used this code and worked very nicely. However, for the pages that I disable the comments and discussion, it still posts this verbiage:

    Comments are closed.

    Want to join the discussion?

    Feel free to contribute!

    When I do NOT allow comments on pages, I’d like for nothing to be displayed. How do I do this?

    #88694

    Hey sheathman,

    Can you post a link to a page with that notice? We might be able to target it with a bit of css so that it doesn’t display on those pages.

    Regards,

    Devin

    #88695
    #88696

    In the comments.php we’ll just make a little adjustment. Go ahead and open that up and at the very bottom of the file replace

    echo "<div class='comment_meta_container'>";
    echo "<h3 class='miniheading'>".__('Leave a Reply','avia_framework')."</h3>";
    echo "<span class='minitext'>".__('Want to join the discussion? <br/>Feel free to contribute!','avia_framework')."</span>";
    echo "</div>";
    echo "<div class='comment_container'>";
    comment_form();
    echo "</div>";
    ?>

    with:

    if ( ! comments_open() ) {
    } else {

    echo "<div class='comment_meta_container'>";
    echo "<h3 class='miniheading'>".__('Leave a Reply','avia_framework')."</h3>";
    echo "<span class='minitext'>".__('Want to join the discussion? <br/>Feel free to contribute!','avia_framework')."</span>";
    echo "</div>";
    echo "<div class='comment_container'>";
    comment_form();
    echo "</div>";
    }

    Regards,

    Devin

    #88697

    When I use this code it removes the entire footer.

    #88698

    1) Open up includes/comments.php and delete following line:

    <p><?php _e( 'Comments are closed.', 'avia_framework' ); ?></p>

    2) Then replace:

    echo "<div class='comment_meta_container'>";
    echo "<h3 class='miniheading'>".__('Leave a Reply','avia_framework')."</h3>";
    echo "<span class='minitext'>".__('Want to join the discussion? <br/>Feel free to contribute!','avia_framework')."</span>";
    echo "</div>";
    echo "<div class='comment_container'>";
    comment_form();
    echo "</div>";

    with:

    if ( comments_open() ) {
    echo "<div class='comment_meta_container'>";
    echo "<h3 class='miniheading'>".__('Leave a Reply','avia_framework')."</h3>";
    echo "<span class='minitext'>".__('Want to join the discussion? <br/>Feel free to contribute!','avia_framework')."</span>";
    echo "</div>";
    echo "<div class='comment_container'>";
    comment_form();
    echo "</div>";
    }

    #88699

    This is perfect. One small addition – now there’s a lot of white space below the final text of each page. Is there a way to condense the white space at the bottom?

    #88700

    Try adding the following CSS to your Quick CSS (located under the Styling Tab in the theme options) or the custom.css file in the css folder of your theme files:

    #top.page .post-entry {
    padding-bottom: 0px;
    }

    Regards,

    Devin

Viewing 14 posts - 1 through 14 (of 14 total)

The topic ‘Enable Comments on Pages’ is closed to new replies.