ejos
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: [AMP] function build_metadata need more info in order to validate as amp pageI solve the problem by changing the function build_metadata() on file plugins/amp/class-amp-post.php to:
private function build_metadata() { $data = array( '@context' => 'http://schema.org', '@type' => 'BlogPosting', // TODO: change this for pages 'mainEntityOfPage' => get_permalink( $this->ID ), 'headline' => get_the_title( $this->ID ), 'datePublished' => get_the_date( 'c', $this->ID ), 'dateModified'=> get_post_modified_time( 'c','' , $this->ID ), 'author' => array( '@type' => 'Person', 'name' => $this->author->display_name, ), 'image' => array( '@type' => 'ImageObject', 'url' => get_the_post_thumbnail_url($this->ID), 'width' => '696', 'height' => '580', ), 'publisher' => array( '@type' => 'Organization', 'name' => get_bloginfo( 'name' ), 'logo' => array( '@type' => 'ImageObject', 'url' => 'http://url_to_my_logo.jpg', 'width' => '187', 'height' => '143', ), ), ); return $data; }Width and height values are my custom values you should change them with your own values.
hope it helps
Forum: Plugins
In reply to: [AMP] Lots of AMP errors (nearly 98% of my pages)I get all my post validated on google webmaster tool for amp using type Blogposting.
I changed the function build_metadata() on file plugins/amp/class-amp-post.php to:
private function build_metadata() { $data = array( '@context' => 'http://schema.org', '@type' => 'BlogPosting', // TODO: change this for pages 'mainEntityOfPage' => get_permalink( $this->ID ), 'headline' => get_the_title( $this->ID ), 'datePublished' => get_the_date( 'c', $this->ID ), 'dateModified'=> get_post_modified_time( 'c','' , $this->ID ), 'author' => array( '@type' => 'Person', 'name' => $this->author->display_name, ), 'image' => array( '@type' => 'ImageObject', 'url' => get_the_post_thumbnail_url($this->ID), 'width' => '696', 'height' => '580', ), 'publisher' => array( '@type' => 'Organization', 'name' => get_bloginfo( 'name' ), 'logo' => array( '@type' => 'ImageObject', 'url' => 'http://url_to_my_logo.jpg', 'width' => '187', 'height' => '143', ), ), ); return $data; }hope it helps
Forum: Fixing WordPress
In reply to: php error…In my case is not a problem of memory. I have the same issue and the solution that worked for me was to upgrade all the plugins in the site.
Regards
Viewing 3 replies - 1 through 3 (of 3 total)