
外掛標籤
開發者團隊
原文外掛簡介
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:
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
