Code to show related posts (custom post type and custom taxonomy/category) is messing with other code
It seemed like you did not call wp_reset_postdata() which in short, restores the context of the template tags (e.g. the_title() and get_the_title()) from a secondary query loop back to the main query loop. More details at https://developer.wordpress.org/reference/functions/wp_reset_postdata/#more-information. So basically, you just need to call wp_reset_postdata() like so, and then the issue in question would disappear: … Read more