• Hi,

    I tried to use custom fields for schema markups without success.
    Please what can I add to functions.php ?
    Can I use Child Theme or Parent Theme ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @hassanb,

    You can use the child theme to add the custom code. Here’s a quick guide to help you get started: [Link to Guide]

    Kind regards,
    Aradhy ??

    Thread Starter hassanb

    (@hassanb)

    Hi, thank you,
    I have added this code to the Child Theme but I got no results.

    // Fonction pour afficher le schema markup
    function display_schema_markup() {
    if (is_single()) {
    global $post;
    $schema_data = get_post_meta($post->ID, 'schema_markup', true);
    if ($schema_data) {
    echo $schema_data;
    }
    }
    }
    add_action('wp_head', 'display_schema_markup');

    Hi @hassanb,

    Could you please try switching to a different theme and then adding the code to that theme’s child theme? This will help us determine whether the code is functioning as expected.

    Kind regards,
    Aradhy ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.