the_title() shows title of the first post instead of the page title?
the_title is a Loop tag. It “Displays or returns the title of the current post” and it is supposed to be used inside the Loop, not outside of it. What you are doing– calling it outside the Loop– is not quite correct, and you are getting inconsistent results. What happens is this: The $post variable … Read more