• Resolved Vrijeme

    (@rinfo)


    I want to add iframe to be displayed below the text in AMP versions of the posts. Which template should I edit?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    You’ll find all the templates over on the plugins GitHub repository. The page.php file may suit what you’re looking for.

    Note that if you’re using the legacy reader theme rather than editing the plugins templates directly you can create an amp folder within your active themes root directory. From there you can copy over any of the reader theme templates and edit to suit your needs. The templates in your active themes amp folder will overwrite the regular reader themes templates.

    Let me know if you have any further questions with the above.

    Plugin Author Weston Ruter

    (@westonruter)

    And rather than edit the templates, I suggest you rather just use a the_content filter which only appends the content when on AMP pages. For example:

    add_filter(
    	'the_content',
    	static function ( $content ) {
    		if ( function_exists( 'amp_is_request' ) && amp_is_request() ) {
    			$content .= '<iframe src="https://example.com/" width="100%" height="400"></iframe>';
    		}
    		return $content;
    	}
    );
    • This reply was modified 3 years, 4 months ago by Weston Ruter.

    @rinfo Hopefully the above was of use. If you need any further assistance on this be sure to let us know. In the meantime I’ll close this support topic.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add iframe in reader mode?’ is closed to new replies.