I’m trying to create a meta-box on pages that pulles in all posts of a category (featured residents) that will hold an ID of the post which can later be pulled on that page in the sidebar.
Pretty simple code, or so I thought. The code I link to below works, but replaces ALL of the post data (title, description, revisions) with the last post in the category I’m looking for.
No idea why, I’m creating a new WP_Query. I’ve also tried setting a $tmp_wp_query = $wp_query and then re-doing it and setting $wp_query back to the temp holder when I’m done. Nothing has worked. I’m stumped. Am I going to have to write a custom SQL statement for this to work?
- The topic ‘WP_Query in add/edit page (adding custom meta box)’ is closed to new replies.