you may like text | WordPress.org

[ad_1]

Hi,

check in the inc/related-posts.php file at sixth line.

Regards.

Thread Starter
soronu

(@soronu)

Thanks a lot

Can you also change the Searching settings, so that the searching results not show pages, only posts?

Just add this code in the functions.php file:

function tg_exclude_pages_from_search_results( $query ) {
    if ( $query->is_main_query() && $query->is_search() && ! is_admin() ) {
        $query->set( 'post_type', array( 'post' ) );
    }    
}
add_action( 'pre_get_posts', 'tg_exclude_pages_from_search_results' );

Regards.

  • This reply was modified 1 hour, 4 minutes ago by saraneve.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer