Display custom fields from custom posts in RSS feed

$price = $wpdb->get_row($wpdb->prepare(“SELECT salePrice FROM ‘ . $wpdb->gm_ads_products . ‘ WHERE post_id = ‘ . $post->ID . ‘”)); // this seems to be the issue Yes, that’s right. First, because $wpdb->prepare() requires at least two parameters, one is the SQL query with placeholders like %d (for numbers) and the other is the replacement values that … Read more

How can I get the number of custom post type posts that have a specific attachment image set?

I ended up figuring it out. I installed the wordpress plugin “Query Wrangler” which helped me build exactly what I was trying to figure out. What was the missing key was instead of the value being ” on the post where the custom field didn’t appear, I should have put ‘0’. Here’s the final working … Read more

Querying Two Custom Post Types with OR Not Working

So the issue seemed to be with my second meta_query array – instead of checking if pub_date EXISTS, I decided to check if wpcf-date-time DOESNT EXIST: $today = date( ‘Y-m-d’ ); $args = array( ‘post_type’ => array(‘research_article’, ‘events’), ‘posts_per_page’ => 10, ‘post_status’ => ‘publish’, ‘orderby’ => ‘meta_value date’, ‘order’ => ‘DESC’, ‘meta_query’ => array( array( … Read more