Applying if (get_post_meta) to new shortcode
First up the display_ad function should have a parameter $content that contains the post’s content upto the point where the shortcode is placed. So you concatenate that $content with your advertisement image before returning it. Second what’s wrong with : if( empty( get_post_meta( $post->ID, ‘wpcf-display-ad’, true ) ) ) { return $content; } else { … Read more