Non-wp db call confuses the Loop (3 posts)

  1. Matt
    Posted 7 years ago #

    I’m calling this script that retrieves rows from some forums tables from the header in WP, but below — when it’s time to get the WP post — WP gets confused and throws up a
    “Not Found
    Sorry, but you are looking for something that isn’t here.”

    WP tables and phpBB3 tables are in the same db, with different prefixes of course.

    I thought it was a variable collision, so I changed all variables in the script from $query to $latestpostsquery, $row to $latestpostsrow, etc. Still not working. Any ideas?

    The script works fine in the WP footer.

  2. MichaelH
    Posted 7 years ago #

    Did you try using a new WP_Query as exemplified in this article:

  3. Matt
    Posted 7 years ago #

    Thanks for the link. Before I dug into that, I played around with my script.

    Turns out if it was a php function, it would cause the problem I stated above. But If I take out the function wrapper around it, it runs fine :-s

    So I'm leaving it alone, and I'm getting by without it being a function.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.