shortcode-Test
getting shortcode
// Add Shortcode function custom_shortcode( $atts ) { // Attributes $atts = shortcode_atts( array( 'post_id' => '', ), $atts, 'custom_shortcode' ); $parent_id = get_post_meta($post_id, '_wpcf_belongs_fair_id', true); $values = $wpdb->get_col("SELECT wpcf_booth_number_1 FROM booth_postmeta WHERE _wpcf_belongs_fair_id= $parent_id"); return count($values); } add_shortcode( 'custom_shortcode', 'custom_shortcode' );