Hello!,
What do you mean with “I put it in functions.php of a child theme.”
I created the folder templates-child in /amp/ directory, and created a functions.php file with this code:
<?php
add_filter( 'amp_post_template_metadata', 'bbm_amp_modify_json_metadata', 10, 2 );
function bbm_amp_modify_json_metadata( $metadata, $post ) {
if (!array_key_exists('image', $metadata)) {
$metadata['image'] = array(
'@type' => 'ImageObject',
'url' => get_template_directory_uri() . '/images/default.png',
'height' => 512,
'width' => 1024,
);
}
return $metadata;
}
?>
Nothing happens, how do I create a child theme of that templates?
So thanks!!
-
This reply was modified 8 years, 3 months ago by
fellowito.
-
This reply was modified 8 years, 3 months ago by
fellowito.