#46 – AMP Recent Posts and Related Posts

Posted in ‘weeblrAMP’
This is a public ticket. Everybody will be able to see its contents. Only enter usernames, passwords or any other sensitive information in the Private information field.
Monday, 18 December 2017 06:59 UTC
Shane_Day
 Hello!

I'm looking at installing one of the above Plugins in conjunction with WeeblrAMP to keep people onsite longer after they have read through my AMP posts/pages.

This is the link to the Recent Posts plugin https://wordpress.org/plugins/amp-recent-posts/

Just setting it up on a test site currently and there is a prompt coming through in the set up.

This -

NB. If you are NOT using the Automattic AMP plugin please implement the recent posts by adding this code to your plugins templates:

<?php echo do_shortcode( "[amp-recent-posts append='amp' heading='Recent Posts' max='5']" ); ?>

Under this is this "Use AMP plugin (Automattic) hook?" with a box to check and this "This will implement the recent posts without the use of shortcode."


So, just seeing....

If this plugin is ok to use?

Do you have something similar in the pipeline made for WeeblrAMP?

Or, where we slot this shortcode if it's ok to use at all this plugin?


Also, I won't be able to check if there are AMP errors with the plugin added to WeeblrAMP, until its setup and I can Validate them.


Thanks in advance, I look forward to your reply.
Monday, 18 December 2017 07:51 UTC
wb_weeblrpress
Hi

If this plugin is ok to use?
As it uses a shortcode, I would suspect so.

Do you have something similar in the pipeline made for WeeblrAMP?
Not really, there are plenty of plugins for related posts, I'm not sure we can add value here.

The recommended way to use such plugin, or any similar plugin for that matter, is to use a widget. You can certainly insert their shortcode directly in the AMP templates, which will give you more control but is more complicated really.

1 - Go to Appearance/Widgets, and you'll see 3 AMP widgets positions:

2 - Drag a Custom HTML widget onto one of the AMP widgets positions. I used "AMP: After content" in this example:
3 - Copy/paste the related posts plugin short code:

4 - Optionally add a title, then save.

Let me know how it goes.

Rgds
 
Monday, 18 December 2017 11:50 UTC
Shane_Day
Thanks for the speedy reply!

I just tried it ur and it doesn't work putting it in the Widget area.

After doing the above I just end up with a "Related Post" title at the top of the AMP page/post.

I think I'll leave this plugin alone as I don't want to muck around with the WeeblrAMP code at all so it can still get updated easily.

Thanks again for your help :)
Monday, 18 December 2017 11:58 UTC
wb_weeblrpress
Hi

OK, I'll try to give a try and will keep you posted as to what I find.

I think I'll leave this plugin alone as I don't want to muck around with the WeeblrAMP code at all so it can still get updated easily.
You do not have to worry about that. weeblrAMP follows WP best practices. Any change you make to the templates, you should do in a child theme, just like you do for your regular website. These changes will not be affected by future updates.

Please have a look at the corresponding documentation, on this page.

Rgds
 
Monday, 18 December 2017 12:03 UTC
wb_weeblrpress
Hi

Reading again your first post, looking up the plugin you mentioned, I think I meay have mislead you. I thought you were trying to use a specific "Recent posts" plugin, but then I realized you actually were looking at an AMP-specific plugin.

You do not need that. Just use the standard WordPress "recent posts" widget, and drop it on the "AMP: after content", and it will work fine. There's no need for an AMP specific version, unless you want to use some custom, advanced AMP features.

Rgds
 
Monday, 18 December 2017 19:48 UTC
Shane_Day
Thanks for that.

Implemented it this morning and checked Validation too.

The standard Wordpress "Recent Posts" plugin worked fine and kept the load time in check too.

That's it, thanks again.
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.