Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1198991
    Braden
    Participant

    I am attempting to place a Leave a reply/comment box on a specific page. It appears that enabling comments on a page does not actually do that. I found this…

    add_action('x_before_the_content_end','page_comment');
    function page_comment() { if ( comments_open() ) : ?>
      <?php echo $container_begin; ?>
        <?php comments_template( '', true ); ?>
      <?php echo $container_end; ?>
    <?php endif; }

    I have added this code to the child themes functions.php and it does work, the only problem is that it spans the entire width of the page and does not conform to the layout. Is it possible to create a new section and embed the code within it or somehow format it to conform with the layout? Any help would be appreciated. Thanks!

    #1199074
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! To resolve your issue, please modify your code and use this instead:

    add_action('x_before_the_content_end','page_comment');
    function page_comment() { if ( comments_open() ) : ?>
      
      <div class="x-section">
        <div class="x-container max width">
    
          <?php echo $container_begin; ?>
            <?php comments_template( '', true ); ?>
          <?php echo $container_end; ?>
    
        </div>
      </div>
    
    <?php endif; }

    Please let us know if this works out for you.

    #1199275
    Braden
    Participant

    Beautiful! Thank you so much, worked perfectly!

    #1199293
    Thai
    Moderator

    Glad it worked 🙂

    If you need anything else please let us know.

  • <script> jQuery(function($){ $("#no-reply-1198991 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>