Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter dantina

    (@dantina)

    Good point about the examples used! I had actually taken some ideas from https://codex.www.ads-software.com/The_Loop_in_Action – to try and check if there’s post first and then do something on the basis of the result.

    Thanks for your help. I’ve taken get_posts() outside the if statement and that did work. I guess I am confused because both pages are OUTSIDE WordPress and since it is the same code, I wasn’t sure why it worked on one page and not the other.

    Dantina

    Thread Starter dantina

    (@dantina)

    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

Viewing 2 replies - 1 through 2 (of 2 total)