// Custom Schema Markup Field
function output_custom_schema_in_head() {
    if (is_single() || is_page()) {
        global $post;
        $schema = get_post_meta($post->ID, 'custom_schema', true);
        if (!empty($schema)) {
            echo '<script type="application/ld+json">' . $schema . '</script>';
        }
    }
}
add_action('wp_head', 'output_custom_schema_in_head');

Leave a Reply

Your email address will not be published. Required fields are marked *