, pegar al final tal cual) // // IMPORTANTE: verifica el slug de tu CPT antes de guardar. // En uListing el slug suele ser 'stm-listings'. // Para confirmarlo: abre cualquier propiedad en WP Admin y mira la URL: // /wp-admin/post.php?post=123&action=edit&post_type=ESTE_ES_EL_SLUG // Reemplaza 'stm-listings' abajo por el slug que veas. add_action( 'init', 'mellado_register_schema_meta' ); function mellado_register_schema_meta() { register_meta( 'post', 'schema_json_ld', array( 'object_subtype' => 'listing', 'show_in_rest' => true, 'single' => true, 'type' => 'string', 'auth_callback' => '__return_true', ) ); } add_action( 'wp_head', 'mellado_output_schema_jsonld', 10 ); function mellado_output_schema_jsonld() { if ( ! is_singular( 'listing' ) ) { return; } $schema = get_post_meta( get_the_ID(), 'schema_json_ld', true ); if ( empty( $schema ) ) { return; } $decoded = json_decode( $schema, true ); if ( json_last_error() !== JSON_ERROR_NONE ) { return; } echo '' . "\n"; }