Reputation: 167
Losing my mind. Long time customizer of Wordpress. THIS query has me baffled.
I have a record in wp_post meta where the following exist:
the following query returns nothing:
if($events = $wpdb->get_results("SELECT post_id FROM wp_postmeta WHERE meta_value = 'frontpage';" )){
print_r($events);
}
What am I doing wrong?
Upvotes: 0
Views: 194
Reputation: 167
OK, for my particular issue, Thanks to Omar Tariq, I have the answer - the page I was making is outside of my Wordpress system, and the theme I am using is a heavily-modified and customized theme with many custom post types. The solution is to SIMPLY use the MYSQL API in PHP, instead of using $wpdb. This was fast, simple and easy. I wish I could delete my question... I'm a bit embarrassed.
Upvotes: 0
Reputation: 7724
global $wpdb;
if($events = $wpdb->get_results("SELECT post_id FROM wp_postmeta WHERE meta_value = 'frontpage';" )){
print_r($events);
}
Upvotes: 1