amp-wp
amp-wp copied to clipboard
Error functions.php
Hi,
We have implemented this code to functions.php to show the picture show but he shows us this error.
add_action( 'pre_amp_render_post', 'xyz_amp_add_custom_actions' );
function xyz_add_custom_actions() {
add_filter( 'the_content', 'xyz_amp_add_featured_image' );
}
function xyz_amp_add_featured_image( $content ) {
if ( has_post_thumbnail() ) {
$image = sprintf( '<p class="xyz-featured-image">%s</p>', get_the_post_thumbnail() );
$content = $image . $content;
}
return $content;
}
This is error -> http://overpress.it/2016/02/11/diego-piacentini-commissario-governo-digitale/amp/
You are missing the amp on the function name, it should be xyz_amp_add_custom_actions and you have xyz_add_custom_actions.
Thanks for the reply :)
Now how can I give a style the image? I would like to resize the image and put it edge to edge if possible.
See this ->

How can I do?