diff --git a/includes/class-wpliveticker2.php b/includes/class-wpliveticker2.php
index 2b29115..1f56ef3 100644
--- a/includes/class-wpliveticker2.php
+++ b/includes/class-wpliveticker2.php
@@ -179,8 +179,9 @@ class WPLiveticker2 {
$output = '
$slug,
),
),
+ 'date_query' => array(
+ 'after' => date( 'c', $last_poll ),
+ )
);
$query = new WP_Query( $query_args );
diff --git a/scripts/wp-liveticker2.js b/scripts/wp-liveticker2.js
index 42aa6c2..9dee3dd 100644
--- a/scripts/wp-liveticker2.js
+++ b/scripts/wp-liveticker2.js
@@ -42,9 +42,14 @@ WPLT2.update = function () {
jQuery.each(update, function (i, u) {
jQuery.each(WPLT2.ticker, function (j, t) {
if (t.s === u.s) {
- // Set HTML content.
- jQuery(t.e).html(u.h);
- // Set last poll timestamp.
+ // Prepend HTML of new ticks.
+ jQuery(t.e).prepend(u.h);
+ // Remove tail, if limit is set.
+ const l = jQuery(t.e).data('wplt2Limit');
+ if (l > 0) {
+ jQuery(t.e).find('li').slice(l).remove();
+ }
+ // Update last poll timestamp.
jQuery(t.e).data('wplt2Last', u.t);
}
});