Check for meta data before it is published

You need to check the $_POST fields as well – or better, instead of – for the same data which is being submitted, find this by the name attribute of the field input – it will probably match the existing keys you have. eg. function add_sermons_automatically($post_ID) { if ( ( (isset($_POST[‘imic_vimeo_video’])) && ($_POST[‘imic_vimeo_video’] != ”) … Read more

Custom field picture instead of post thumbnail on category page

I reckon you use the image URL in your custom field. $metro_creativex_posttitle = get_the_title(); // Not used in this snippet /* // you don’t need this block $metro_creativex_feat_image = wp_get_attachment_image_src( $post->ID, get_field(‘sd_single_img’), ‘single-post-thumbnail’ ); */ // you’ll need `$post_id` for each song $img_src = get_field(‘sd_single_img’, $post_id); if( !empty( $img_src ) ) { // echo if … Read more

meta_query ‘compare’ => ‘!=’ not working

try this second query $c_client_args = array( ‘post_type’ => ‘clients_testimonials’, ‘posts_per_page’ => 999, ‘order’ => ‘ASC’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘c_client_feature’, ‘compare’ => ‘NOT EXISTS’ ), array( ‘key’ => ‘c_client_feature’, ‘value’ => ‘on’, ‘compare’ => ‘NOT IN’ ), ) );