Этот плагин не тестировался с последними 3 основными выпусками WordPress. Скорее всего, он уже не поддерживается и может быть несовместим с текущими версиями WordPress.

AMP Recent Posts

Описание

Adds recent posts to your AMP content. Extends the AMP plugin (Automattic) via options page, works alongside all other AMP plugins by use of shortcode added to the plugins template. Shortcode allows to customize the endpoint of the links (to fit the AMP plugin you are using), add a title, and set a limit to the total amount of links.

NEW IN 2.0

If you make use of the popular AMP plugin by Automattic you can now use of the new options page! The plugin uses the AMP footer hook to add Recent Posts to your AMP content and comes with a series of new functions:

  • Post type support: return posts, pages or any other including custom post type

  • Display featured images

  • Display the date

  • Exclude posts by ID

  • Change the priority of the hook

As well the default options of setting a custom endpoint, heading and max number of posts.

With the 2.0 update we completely rewritten the plugin (better queries, better compatibility, bug fixes) with you in mind. Although we’ve tested
extensively something might have slipped through, kindly let us know if you find any
inconsistencies, thank you!

This plugin is actively maintained but will not be supported. I will however try to answer any questions in the comment section of the plugin website and create a FAQ here in the repository.

Скриншоты

  • Rendering of plugin including featured image and date
  • Rendering of plugin including date
  • Plugin options page

Установка

Using the AMP plugin by Automattic

  1. Upload and activate plugin
  2. Visit the plugin options page and set your preferences

Using shortcode

  1. Upload and activate plugin
  2. Place this code in your AMP template:

<?php echo do_shortcode( "[amp-recent-posts]" ); ?>

Shortcode: Customizing the display of the AMP Recent Posts plugin:

  • append=’amp’ change the endpoint to suit your own. Depending on which AMP plugin you are using you can adjust the slug to direct to the AMP articles, standard: ‘amp’ (appropriate for the AMP plugin by Automattic).

Example: append=’amp-post’ will generate a slug ‘yourwebsite.nl/post/amp-post/’

  • heading=’Recent Posts’ will add an H3 heading, standard: none

  • max=’5′ will set a limit to the amount of posts displayed:, standard: 10

  • The code can now look like this:

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

Depreciated and backwards compatibility

If you are using the AMP plugin by Automattic you might have used a custom hook to implement the code in your theme’s functions.php file. Since the 2.0 update this can now be handled by the plugin setting on the options page. If you wish to keep using the hook please update it like so:

//* Add content to the AMP template footer (AMP plugin Automattic)
//* Place in your theme's functions.php



function add_rec_to_amp_footer() {

if ( function_exists('is_amp_endpoint') )
?>



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

<?php

}


add_action( 'amp_post_template_footer', 'add_rec_to_amp_footer', 3 );

Часто задаваемые вопросы

None yet.

Отзывы

Amazing plugin

Works good and well coded with multiple options and help in it to customize it, tested it in 3 sites and multiple browsers!
Посмотреть 1 отзыв

Участники и разработчики

«AMP Recent Posts» — проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:

Участники

Перевести «AMP Recent Posts» на ваш язык.

Заинтересованы в разработке?

Посмотрите код, проверьте SVN репозиторий, или подпишитесь на журнал разработки по RSS.

Журнал изменений

1.0

Release date: July 4th, 2016

1.1

Release date: October 10th, 2016

  • Updated installation tips to new version AMP plugin

2.0

Release date: October 31st, 2016

  • Rewritten plugin with better queries
  • Added functions post type support, featured images, display date, exclude posts and set hook priority for users of the AMP plugin by Automattic
  • Various compatibility improvements

3.0

Release date: November 8th, 2016

  • Removed default settings in options page
  • Small changes in CSS for better compatibility with our other plugins
  • Various small bug fixes

3.1

Release date: December 20th, 2016

  • Update WP 4.7