The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
How to move WPDiscu...
 
Share:
Notifications
Clear all

[Solved] How to move WPDiscuz Comments above Contextual Related Posts

8 Posts
2 Users
0 Likes
925 Views
Posts: 31
Topic starter
(@supertrooper)
Trusted Member
Joined: 3 years ago

We have been using echo_crp to position Contextual Related Posts in the posts and pages by inserting the following code into the content-single.php and content-page.php files in the child theme:

/var/www/focusingonwildlife.com/news/wp-content/themes/sparkling-child/template-parts

<?php if ( function_exists( ‘echo_crp’ ) ) { echo_crp(); } ?><br />

However the WPDiscuz Comments are positioned below the Contextual Related Posts. i.e. the comments are at the very bottom of the post. This disconnect between the post and the comments is not ideal, and readers probably forget to post comments if they get side-tracked by the Related Posts.

So the question is how can we move WPDiscuz Comments above Contextual Related Posts?

7 Replies
Asti
Posts: 7117
 Asti
Support
(@asti)
Illustrious Member
Joined: 6 years ago

@supertrooper,

You should change the location of the comments_template() function.

2 Replies
(@supertrooper)
Joined: 3 years ago

Trusted Member
Posts: 31

@asti

I am not a coding expert, so let me illustrate the files we currently have in the child theme:

1) single.php file has not been successfully modified with the crp script, and the complete address is as follows: /var/www/focusingonwildlife.com/news/wp-content/themes/sparkling-child/single.php

You can access and/or download this file on the link:  https://drive.google.com/file/d/1gsAP96XVSZHYCRqxWolIfB6PHf5QOv9A/view?usp=sharing

2) content-single.php file contains the echo_crp script and the complete address is as follows: /var/www/focusingonwildlife.com/news/wp-content/themes/sparkling-child/template-parts/content-single.php

You can access and/or download this file on the link:  https://drive.google.com/file/d/1q4DVk8cD6GavXqJSda-LDt1welM9OsY9/view?usp=sharing

Please advise in detail what I need to do to change the location of the comments_template() function.

 

Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 7117

@supertrooper,

Please follow the steps below:

1. Cut the following part from the single.php file: 

<?php if ( comments_open() || '0' != get_comments_number() ) :
				comments_template();
				endif;  ?>

2. Paste it in the content-single.php file before the line:

<?php if ( function_exists( ‘echo_crp’ ) ) { echo_crp(); } ?><br />

However be careful, after making the changes, please check and make sure there is no problem with other post types.  

Posts: 31
Topic starter
(@supertrooper)
Trusted Member
Joined: 3 years ago

@asti

Your instructions were followed but without success (see attached screenshot).

Is there anything else we can try?

14 03 2021 13 47 21

 

Posts: 31
Topic starter
(@supertrooper)
Trusted Member
Joined: 3 years ago

@asti

There is another file in the theme – comments.php – which You can access and/or download on the link:

https://drive.google.com/file/d/1-DGrbvoiPJld8a9Y5nEzz5PSnrtENaH5/view

Could changes to this file enable us to position CRP below WPDiscuz Comments?

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 7117

@supertrooper,

I've corrected my previous post (the red marked parts were added in the code). 

<?php if ( comments_open() || '0' != get_comments_number() ) :
				comments_template();
				endif;  ?>

You should paste the code above in the content-single.php file before the line:

<?php if ( function_exists( ‘echo_crp’ ) ) { echo_crp(); } ?><br />
Posts: 31
Topic starter
(@supertrooper)
Trusted Member
Joined: 3 years ago

@asti

Now it works perfectly

Thanks for the great support.

Share: