setup_postdata() does not seem to be working?

I could be wrong, but from what I’m seeing, “setup_postdata()” should be used when doing a custom select query (not just query_posts):
http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query

As well, if you want to use tags like “the_title()” and “the_permalink()” with that custom select query … you’ll need to use the variable name $post specifically (not another variable name) in setup_postdata() – AS WELL – you should call global $post before your “foreach” loop…

So basically follow that example in that codex link. And don’t change the variable name $post – otherwise it breaks it.

HTH

Leave a Comment