跳到内容

Neuedaten News Ticker

v1.0.0

bastianschwabe · 2026年8月30日 上架

A lightweight announcement bar with headline, teaser and call-to-action button. Schedule items, rotate them, and let long text scroll.

正在使用
10 以下
评分
暂无
累计下载
237
最近更新
2026年8月31日
需要 WordPress 6.7+已测试到 7.1.5PHP 7.4+

贡献者

截图

The announcement bar on the front end.
The announcement bar on the front end.
Editing a ticker item, including the optional schedule.
Editing a ticker item, including the optional schedule.
The settings screen.
The settings screen.

News Ticker adds a slim announcement bar to your site — for a sale, a deadline, a service notice or any other message that should not wait for the next blog post.

Each announcement is a separate item with its own headline, teaser and button, so you can prepare several of them and switch them on and off one by one. If more than one item is live, the bar rotates between them. If a message is too long for the available width, the text scrolls while the button stays put on the right.

Features

  • Unlimited announcement items, each with headline, teaser and a button (label + link)
  • Publish or unpublish items individually, plus an optional start and end date per item
  • Automatic rotation when several items are live, paused on hover and keyboard focus
  • Scrolling text only when it is actually needed — the button never moves
  • Optional fixed bar at the top of the viewport, with the page content offset automatically
  • Show the bar on all pages or on the front page only
  • Place the bar right after the opening body tag, inside any element of your theme, or wherever your template prints it
  • Optional dismiss button, either remembered across visits or for the current page view
  • Stylesheet and script can each be switched off if you prefer your own
  • No dependencies, no external requests, no tracking. Plain CSS and vanilla JavaScript.

Styling

The bar ships with a yellow background and black text and exposes every colour as a CSS custom property, so a theme can restyle it without fighting specificity:

.neuedaten-news-ticker {
    --neuedaten-news-ticker-bg: #ffdd00;
    --neuedaten-news-ticker-fg: #000;
    --neuedaten-news-ticker-button-bg: #000;
    --neuedaten-news-ticker-button-fg: #ffdd00;
}

Placing the bar from your theme

Set “Position in the DOM” to Placed by the theme and print it wherever you like — this renders server side, so there is no layout shift:

<?php
if ( function_exists( 'neuedaten_news_ticker_has_items' ) && neuedaten_news_ticker_has_items() ) {
    neuedaten_news_ticker_render();
}
?>

neuedaten_news_ticker_get_html() returns the markup instead of printing it, and the `[news_ticker]` shortcode works in content.

For developers

  • neuedaten_news_ticker_items — filter the items before they are rendered
  • neuedaten_news_ticker_should_render — decide per request whether the bar appears
  • neuedaten_news_ticker_before_render — action fired right before the markup is printed
  • neuedaten_news_ticker_html — filter the final markup
  • neuedaten_news_ticker_settings — filter the resolved plugin settings

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums