Viewing 4 replies - 1 through 4 (of 4 total)
  • Additionally, the “add meta tags” plugin allows to specify the logo image resolution, seperated with a comma. AMP does not recognize that and omits height and width completely, also creating erros on Google console for AMP.

    Theme Graphene

    @allpha_de

    ask the “add meta tags” plugin author to update it to work with AMP. If it causes issue, that is not the fault of AMP plugin.

    Hello all,

    @luciole135

    I’m the developer of the Add-Meta-Tags plugin and would be very interested in understanding this problem better, try to replicate it and hopefully fix it.

    Thanks in advance for your feedback!

    Since 2.10.10 it is possible to select an author image from the media library. In that case, only the attachment ID is stored in the form field. The image dimensions are retrieved directly from the attachment.

    However, this image does not integrate with any WordPress functionality, but is solely used in the metadata on the author archive or when constructing the author’s Person Schema.org entity.

    Here is an example about how to retrieve information about this image and use it as you see fit:

    // Assuming that $user is a WordPress user object and that an image
    // has been set in the user's profile page in the 'Add-Meta-Tags ->
    // Image URL' field. This field accepts both an attachment ID
    // (integer) and a special notation for using an external image
    // (URL,WIDTHxHEIGHT)
    //
    // In the following example it is assumed that the field contains
    // an attachment ID.
    //
    // First, retrieve some data about that image using an internal
    // Add-Meta-Tags function.
    
    $attachment_id = absint( amt_get_user_meta_image_url( $user->ID ) );
    
    // Then we get info about the desired size, eg 'medium',
    // using the WP API
    
    $image_info = wp_get_attachment_image_src( $attachment_id, 'medium' );
    
    // $image_info is an array. [0]: image url, [1]: width, [2]: height

    You can use this data in any way you see fit, for example in the AMP page.

    Add-Meta-Tags does not alter the functionality of other plugins or use their hooks to insert its data. This is because I think this decision has to be made by the user. If you need any help with it, please let me know in the plugin support forums or on Github.

    Thank you all again for your feedback.

    George

    Hi again @luciole135

    FYI, the next release of the plugin will have these template tags which can be used to retrieve the user image as set in the AMT section of the user profile page or print an img HTML element for it.

    BTW, in 2.10.12 it will be possible to override the avatar url as returned by the get_avatar_url() WP API function with the url of the image you have set in the user profile page in the WP Admin under the Add-Meta-Tags section by adding the following in the theme’s functions.php:

    add_filter('amt_set_user_image_as_avatar', '__return_true');

    This should also make the AMP plugin use that image as avatar.

    If you need more help, please let me know.

    Kind Regards,
    George

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem with the author's image.’ is closed to new replies.