Hi Heavox,
Thanks for your response but I am assuming the have_posts() function is supposed to check if there’s any post using some in-built query; that way, you could do something else if there’s no post. I am following the instructions here: https://codex.www.ads-software.com/Integrating_Wordpress_with_Your_Website – which uses the codes in the same way to get posts from outside WP environment.
Besides, I am doing exactly the same thing on the other page and it works, so I don’t think that’s the problem.
Dantina