Site logo

Archived topic

Generatepress AMP customization related query

7 replies · Started by Keshav on April 11, 2021

Viewing posts 1–8 of 8

Hi,

Today I have configured AMP for my website dilsedeshi.com

I want to customize page, Please help

1. I want to remove Author, Article published date and comment counter before featured image.
2. I don't want to show tags in post.
3. I want related post after post.

Thanks in advance.

Hi there,

Not sure if I fully understand. How are those questions related to AMP?

Actually I want to customize AMP page only now

Hi there,

can you share a link to your site so we can see how his content is added

I don't see some of the elements you want to remove on the AMP page.
But for 1 and 2 - you can use the Blog Options filter:

https://docs.generatepress.com/article/option_generate_blog_settings/

Here is an example of that filter being used to disable different options for an AMP page:

add_filter( 'option_generate_blog_settings', 'db_amp_blog_options' );
function db_amp_blog_options( $options ) {
    if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
      $options['single_date'] = false;
      $options['single_author'] = false;
      $options['single_categories'] = false;
      $options['single_tags'] = false;
    }
    return $options;
}

For Number 3 - this not something we can change you would need to ask the plugin developer.

Thank you so much. I have converted AMP into transition mode now so problem has been solved.

Glad to hear that!

This archived topic is closed to new replies.