• Resolved atamrt

    (@atamrt)


    standart subtitle ( excerpt ) is not showing on amp pages.
    How can we add it?

    Regards

Viewing 1 replies (of 1 total)
  • If you are using transitional or standard mode then the excerpt should appear by default. Both modes use your active templates layout, content and styling.

    If you are using reader mode and want to add the excerpt to single post pages you can created a template override or add the following function, which will place the excerpt above the content.

    function add_excerpt ($content){
     if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
    	 $the_post = get_post($post_id);
         $excerpt = $the_post->post_excerpt; 
    	$content = $excerpt . $content ;
     }
    	return $content;
    }
    add_filter ('the_content', 'add_excerpt');
Viewing 1 replies (of 1 total)
  • The topic ‘how to add subtitle’ is closed to new replies.