Position of Comments

Hi,

at the moment my comments are displayed at the end of each post. I like to display my comments right after my Sharing Buttons in every post: https://one-million-places.com/reiseberichte/europa/griechenland/santorini-oia

I know that I can do that in the entry-footer in my template content.php in my X child folder.
But which code do I have to add there to move the comment section from the bottom of the page to this position?

Michael

Hi Michael,

To achieve that, please do the following:

  • Create a copy of this file from your parent theme to the child theme:
    /x/framework/views/integrity/wp-single.php

  • Edit the previous file in your child theme directory and comment out one specific line, by replacing this line:

<?php x_get_view( 'global', '_comments-template' ); ?>

with:
<?php //x_get_view( 'global', '_comments-template' ); ?>

  • Then add this snippet to functions.php file in your child theme directory:
function insert_comments_after_content() { 
	x_get_view( 'global', '_comments-template' ); 
}

add_action( 'x_before_the_content_end', 'insert_comments_after_content' );

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.