Skip to content
This repository has been archived by the owner on Oct 10, 2018. It is now read-only.

Commit

Permalink
Merge pull request #84 from xwp/add/amp-live-list-sorting
Browse files Browse the repository at this point in the history
Add sort=ascending to amp-live-list for comments when asc order
  • Loading branch information
kienstra authored Apr 2, 2018
2 parents 54cce03 + 47dc200 commit 2b219bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@

<div class="comments wrap__item">

<amp-live-list id="amp-live-comments-list-<?php the_ID(); ?>" class="live-list" layout="container" data-poll-interval="<?php echo esc_attr( AMPCONF_LIVE_LIST_POLL_INTERVAL ); ?>" data-max-items-per-page="<?php echo esc_attr( get_option( 'page_comments' ) ? get_option( 'comments_per_page' ) : 10000 ); ?>">
<?php $sort_attr = ( 'asc' === get_option( 'comment_order' ) ) ? ' sort="ascending" ' : ''; ?>
<amp-live-list id="amp-live-comments-list-<?php the_ID(); ?>" class="live-list" layout="container" <?php echo $sort_attr; // WPCS: XSS OK. ?> data-poll-interval="<?php echo esc_attr( AMPCONF_LIVE_LIST_POLL_INTERVAL ); ?>" data-max-items-per-page="<?php echo esc_attr( get_option( 'page_comments' ) ? get_option( 'comments_per_page' ) : 10000 ); ?>">
<ol items class="comments__list">
<?php
wp_list_comments( array(
Expand Down

0 comments on commit 2b219bf

Please sign in to comment.