OHello guys,
A new model of pages was created recently, AMP and FBIA, removing most of the data of a page leaving it much simpler and lighter. This will work for posts of texts.
I’m using the AMP plugin from Automattic (https://wordpress.org/plugins/amp/) to create the pages AMP, along with the Glue plugin for Yoast SEO & AMP (https://wordpress.org/plugins/glue-for-yoast-seo-amp/), nd the plugin Facebook Instant Articles & AMP Google Pages by PageFrog (https://wordpress.org/plugins/pagefrog/) to customize and create posts in FBIA.
But none of these plugin carry the social buttons, and neither the embeds videos from Youtube.
Even though pages faster, causing the ranking of my website in Google search results, I believe that on the one hand you have a greatly increased traffic on pages AMPs, but visitors will not be able to share and disseminate the posts.
Another problem is with embed video from Youtube. The theme has how to create posts with videos on top (e.g. http://proddigital.com.br/play/esportes-fitness/q48/peso-ideal-qual-meu-peso-ideal/), but when accessing via AMP (ex.: http://proddigital.com.br/play/esportes-fitness/q48/peso-ideal-qual-meu-peso-ideal/amp/) appears only the highlighted image. This will cause that didn’t have a quick page logic, consequently more visits being that none of these visitors will be able to see the videos.
So I was wondering of you, there’s nothing to do on the subject to the possibility of social buttons being converted into AMP and FBIA? And also in the case of Youtube videos, I saw in the project amp (https://www.ampproject.org/pt_br/docs/guides/amp_replacements.html#include-a-video) that the version amp accept iframe (iframe-amp) which is the format used to call the Youtube video. But to work, you have to put a script on the page <head> amp.
I tried to put this script in the <head> in the subject, and he appears only on the original page, but not on the page.
Is there anything that can be done on the subject?
I appreciate.
Rodrigo Carlos
You need to use the filter hooks from the AMP support page to “add” the video to footer of your AMP pages, as the AMP “pages” from your post only pulls the materials in the “post box” — not any plugins or custom coding from your theme. So the AMP version will only get videos which are “inline” to the post and not “featured” videos or images.
So, you generally need to “roll your own” social buttons, or use a plugin that is AMP friendly that will “insert” things at bottom of the AMP footer (e.g., we use a related posts plugin that does this).
Often with a video, you can simply use a normal post, then put the video at top inline using oembed vs making a “featured video” unless you want to come up with your own workaround.
This is how we have been doing on our sites since the beta started last November.
That may not be any help; just food for thought in that with most AMP customizations, hooking into AMP from a theme developer perspective is a like having to manage an entirely new theme.
TagDiv would almost need to make a separate plugin to sell just to cover costs of the support on doing that.
“So, you generally need to “roll your own” social buttons, or use a plugin that is AMP friendly that will “insert” things at bottom of the AMP footer (e.g., we use a related posts plugin that does this).”
In this case, you’ve used a related posts plugin to insert social buttons?
When using some plugin to insert social buttons on the body of the text, would make the plugin amd collect the codes of button and show page amd, but would also be shown in the original page and already have the social buttons.
“Often with a video, you can simply use a normal post, then put the video at top inline using oembed vs making a “featured video” unless you want to come up with your own workaround.”
In the case of the video, what do you mean, would put the video in the body of the text (in the first line), is it?
If so, then I would have to change the layout of the theme (style 11) for a simpler layout as, for example, the style 5, is it? That way, and could not work with the 9, 10 and 11 style?
I appreciate.
You can embed shortcodes into a custom snippet of any code, like ads, etc., using the filter hooks in the AMP plugin docs to add a block of code at footer in the AMP template.
For videos, yes, we use the template with “no featured image” for the post, then put the video at top of the post box. We also do this for some book reviews where the book cover is tall and skinny and doesn’t work well for any of the featured sizes.
Or, you could create custom field for your video, then add an amp-iframe video box by inserting the shortcode at footer of the amp template.
By example to play with, which must be added to main functions.php
//Chris EXAMPLE AMP FOOTER
add_action( 'amp_post_template_footer', 'xyz_amp_add_pixel' );
function xyz_amp_add_pixel( $amp_template ) {
$post_id = $amp_template->get( 'post_id' );
?>
<div class="s2pamp02">
<p><em>My super special copyright notice goes here.</em></p>
<!--Related posts / or any compatible shortcode for plugin-->
<?php if ( function_exists( 'echo_ald_crp' ) ) echo_ald_crp(); ?>
</div>
<hr/>
<div class="s2pamp01">
<hr/>
<h2><strong>Wow it's Chris' headline!</strong></h2>
<p>You can put text here, isn't it amazing!</p>
<hr/>
</div>
<?php
}
//END
-
This reply was modified 9 years by
simchris.
This code to insert into the functions.php, so that I can use the Style 11? Or even that use the Style 5?
And another thing … This solution is to insert on pages amp, but I don’t edit the pages amp manually. They are created automatically by the plugin of Automatic AMP.
The problem here is that, with the use of the amp, my site will never be able to use the Style 11.
And another problem is that when choosing the Style 5, I’m going to have to change post by post, and insert the url of the youtube video in the body of the text. A rework … that if in the future there is the possibility to use the Style 11, I’m going to have to do this all again rework, post by post, which will likely have more post now.
I use the plugin “AMP-Yoast SEO”, and it has two fields where I can insert CSS and Extra code in (only meta and link) to be inserted in the <head> when it is converted to amp. So, would have some code that could collect the url of the youtube video and automatically insert at the beginning of the text, when amp page?
If access the original page, so keep as is (Style 11). But if it is the amp page access, so this code collects the url of the youtube video and insert text automatically. More or less it.
Yes, hence the “roll your own” to come up with a solution that works for your particular site. No one click solution, so take my posts here as just fodder for trying things for your particular purpose. I don’t have a solution based on your use. We have a workaround working here, but then we started on the beta almost a year ago, and were “ready” for Feb. roll out. So, we had time to mess with it.
Hi,
Sorry but our theme has no implementation for amp and FBIA for the moment. It will have to be done through plugins and customization if you want to get it going. We will look into it and make our theme amp friendly in the future but for the moment I cannot promise anything.
Thank you!