No results found. Try again with different words?

Search must be at least 3 characters.

Move Related Posts Below Comments

Sidebar Image

Did not find a solution? We are here to help you succeed.

With the Astra theme, you can display related posts on all your posts. This document will provide a custom code to move related posts below the comments section.

What Is The Result?

The related posts section is displayed below your post content by default. Also, itโ€™s a great feature that helps your users find additional interesting content from the same category. But, at the same time, this means that your users might overlook the comments section before moving to a related post.

Related Posts

Thus, you might want to move this section below the comments section, allowing your user to first go through comments. Further, you can do this easily by adding a custom code to your website.

Related Posts Below Comments

How To Do This?

To disable Astra Global colours in Elementor, you need to add an action. You can add the following custom code to the functions.php file of your Child Theme:

# Move Related Posts Below Comments

add_action( 'astra_entry_before', function() {
	add_filter( 'astra_get_option_enable-related-posts', '__return_false' );
} );
add_action( 'astra_primary_content_bottom', function() {
	add_filter( 'astra_get_option_enable-related-posts', '__return_true' );
} );
add_action( 'astra_template_parts_content_top', 'action_to_update_related_post_markup', 1 );
function action_to_update_related_post_markup() {
	$related_post_markup_instance = new Astra_Related_Posts_Markup();
	add_action( 'comment_form_after', array( $related_post_markup_instance, 'astra_get_related_posts' ), 10 );
}

If you donโ€™t have your Child Theme installed, please check this article on how to do it. 
If you are not sure how to add this code, please check this article.

Was this article helpful?
Sidebar Image

Did not find a solution? We are here to help you succeed.

Related Docs

Join 1,653,898+ Happy Site Owners Using Astra

Whether you are a beginner, small business owner, or professional web developer, Astra provides all the tools you need to easily build your beautiful WordPress website.

Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form