| 开发者 | bastianschwabe |
|---|---|
| 更新时间 | 2026年8月31日 01:13 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
.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 renderedneuedaten_news_ticker_should_render — decide per request whether the bar appearsneuedaten_news_ticker_before_render — action fired right before the markup is printedneuedaten_news_ticker_html — filter the final markupneuedaten_news_ticker_settings — filter the resolved plugin settings/wp-content/plugins/ or install it through the Plugins screen.Set the item to draft. Only published items inside their schedule are shown.
The bar rotates between them. You can set the interval under Info Ticker → Settings; rotation pauses while a visitor hovers over the bar or focuses an element inside it.
The text only scrolls when it does not fit into the available width. Make the browser window narrower, or use a longer teaser, to see it.
Two ways. Without touching your theme, choose "Inside a target element" under Info Ticker → Settings and enter a CSS class or ID, for example .page-header. The bar is inserted as the first child of the first matching element; this needs the plugin JavaScript, and the fixed position option is ignored.
If you can edit your theme, choose "Placed by the theme" instead and call neuedaten_news_ticker_render() in your template. That renders server side, so the bar is there from the first paint and reserves its space without a layout shift.
Yes, with reduced functionality. The first live item is shown, the text is truncated instead of scrolling, and the dismiss button is hidden.
Yes, through the CSS custom properties listed in the description, or by switching the plugin stylesheet off and writing your own.