• Resolved gucoriw

    (@gucoriw)


    This is my workaround.
    //Copy Schema to AMP version.
    Add to wordpress\wp-includes\functions.php

    add_filter( ‘amp_post_template_metadata’, ‘xyz_amp_modify_json_metadata’, 10, 2 );
    function xyz_amp_modify_json_metadata($metadata, $post) {
    $arr = get_post_custom_values(‘metadata’);
    $metadata = unserialize($arr[1]);
    return $metadata;
    }

    Mod. wordpress\wp-content\plugins\wp-structuring-markup\includes\wp-structuring-display.php
    line 173: add_post_meta($post->ID, “metadata”, $args);

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter gucoriw

    (@gucoriw)

    Corrections:

    add_filter( ‘amp_post_template_metadata’, ‘xyz_amp_modify_json_metadata’, 10, 2 );
    function xyz_amp_modify_json_metadata($metadata, $post) {
    $arr = get_post_custom_values(‘_schema’);
    $metadata = unserialize($arr[0]);
    return $metadata;
    }

    Mod. wordpress\wp-content\plugins\wp-structuring-markup\includes\wp-structuring-display.php
    line 173: global $post;
    line 174: update_post_meta($post->ID, “_schema”, $args);

    • This reply was modified 7 years, 7 months ago by gucoriw.
    Plugin Author miiitaka

    (@miiitaka)

    Hi, @gucoriw

    Version 4.0.1 has been released.
    I added the function, so please try it.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Feature: Support for AMP’ is closed to new replies.