Skip to content

Use Custom Logo instead of Site Icon for Publisher Logo #975

@westonruter

Description

@westonruter

The Site Icon was the best default we had at the time that Schema.org metadata were introduced in v0.3 (Feb 18, 2016) of the plugin:

https://github.com/Automattic/amp-wp/blob/ac753c4aeb60386e5e1364747aeb1952b853d86d/includes/amp-helper-functions.php#L399-L417

However, in WordPress 4.5 (April 2016) the Custom Logo feature was introduced. The Custom Logo is a much better choice than Site Icon since the latter is square and this is against the logo guidelines:

  • The logo should be a rectangle, not a square.
  • The logo should fit in a 60x600px rectangle., and either be exactly 60px high (preferred), or exactly 600px wide. For example, 450x45px would not be acceptable, even though it fits in the 600x60px rectangle.

We should opt for Custom Logo when it is defined, and we should use the requested dimensions if available. This would use involve something like:

$custom_logo_id = get_theme_mod( 'custom_logo' );
if ( $custom_logo_id && 'attachment' === get_post_type( $custom_logo_id ) ) {
    $img = wp_get_attachment_image_src( $custom_logo_id, 'full', false );
    // ...
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions