Documentation / Ditty News Ticker / General / Settings Overrides

Settings Overrides

For the most part the settings you set for your ticker will be all you need. But, suppose you would like to use the same ticker in multiple parts of you site with minor differences. Most settings include attribute overrides that you can add to shortcodes or direct functions to modify the settings of a ticker.

Shortcode attribute overrides

Add the an attribute with the override name and value to your shortcode.

Example: The following sets the rotate delay to 4 seconds, hides the ticker title, adds some custom classes, and adds a unique ID.

[ditty_news_ticker id="15" rotate_delay="4" title="0" class="blue-tickers, custom-class" unique_id="56"]

Direct function attribute overrides

Create an attributes array to pass with your function. Add key/value pairs to override any settings.

Example: The following sets the scroll direction, scroll speed, tick spacing, and a unique ID.
*Note: Custom classes are not added to the attributes. They are passed separately as the second argument.

$atts = array(
  'scroll_direction' => 'right',
  'scroll_speed' => 7,
  'scroll_tick_spacing' => 30,
  'unique_id' => 10023
ditty_news_ticker( 15, 'my-custom-class, your-custom-class', $atts );

Custom Classes

You can also add custom classes to your ticker by adding a class attribute to your shortcode or direct function. Add classes just like you normally would to an html element (comma separated).

Unique ID’s

If you do have the same ticker used more than once on a single page you need to set a unique_id to the duplicate tickers. This is required… or else your site will blow up! Just kidding, but it is necessary if you don’t want your tickers to act funky (add techy, jQuery description here). Unique ID’s can be anything you want, but the easiest thing to do is add a unique number.