Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • where to paste the code? in which file ?

    add_filter( ‘amp_post_template_metadata’, ‘xyz_amp_modify_json_metadata’, 10, 2 );

    function xyz_amp_modify_json_metadata( $metadata, $post ) {
    $metadata[‘@type’] = ‘NewsArticle’;

    $metadata[‘publisher’][‘logo’] = array(
    ‘@type’ => ‘ImageObject’,
    ‘url’ => get_template_directory_uri() . ‘/images/my-amp-metadata-logo.png’,
    ‘height’ => 60,
    ‘width’ => 600,
    );
    return $metadata;
    }

    Thanks

    I have the same problem ??

    Thread Starter sokae

    (@sokae)

    Hello Leon2017, thanks for your help. But the problem is on

    <script type=”application/ld+json”>{“@context”:”http:\/\/schema.org”,”@type”:”BlogPosting”,”mainEntityOfPage”:”xxxx”,”publisher”:{“@type”:”Organization”,”name”:”xxx”},”headline”:”xxx”,”datePublished”:”2016-02-28T11:50:51+00:00″,”dateModified”:”2016-02-28T11:50:51+00:00″,”author”:{“@type”:”Person”,”name”:”xxx”},”image”:{“@type”:”ImageObject”,”url”:”xxx”,”width”:768,”height”:432}}</script>

    On my AMP page doesn’t appear the info: “logo”:{“@type”:”ImageObject”,”url”:”xxx”,”width”:x,”height”:x}}

    Why? Any solutions?

Viewing 3 replies - 1 through 3 (of 3 total)