Title: Direct function for Ditty
Last modified: July 27, 2022

---

# Direct function for Ditty

 *  [marcwillems](https://wordpress.org/support/users/marcwillems/)
 * (@marcwillems)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/direct-function-for-ditty/)
 * In the legacy news ticker I added the ticker to my child theme header via the
   suggested php code:
    <?php if(function_exists(‘ditty_news_ticker’)){ditty_news_ticker(
   204639);} ?>
 * How can I do this with the new Ditty for a slider?

Viewing 1 replies (of 1 total)

 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/direct-function-for-ditty/#post-15863840)
 * The easiest way to globally add a new Ditty is by using the Global Ditty settings
   located at **Ditty > Settings > Global Ditty**. You just need to know and add
   an html selector for an element that you want your Ditty to be place either in
   or before/after, and then select the Ditty you want to display. It will then 
   show up automatically in that spot on your site without having to modify any 
   theme files.y
 * If you still want to manually add a Ditty to your theme files, you can use the
   following code (set the ID to your Ditty’s ID):
 *     ```
       <?php
       if ( function_exists( 'ditty_render' ) ) {
       	$args = array(
       		'id' => 1912,
       	);
       	echo ditty_render( $args );
       }
       ?>
       ```
   
 * You can also set a custom display (this is not currently being used by the Ditty)
   by using (and changing the display ID to the display you want to use:
 *     ```
       <?php
       if ( function_exists( 'ditty_render' ) ) {
       	$args = array(
       		'id' => 1912,
       		'display' => 2003
       	);
       	echo ditty_render( $args );
       }
       ?>
       ```
   
 * Let me know if you have any further questions.

Viewing 1 replies (of 1 total)

The topic ‘Direct function for Ditty’ is closed to new replies.

 * ![](https://ps.w.org/ditty-news-ticker/assets/icon.svg?rev=2650696)
 * [Ditty – Responsive News Tickers, Sliders, and Lists](https://wordpress.org/plugins/ditty-news-ticker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ditty-news-ticker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ditty-news-ticker/)
 * [Active Topics](https://wordpress.org/support/plugin/ditty-news-ticker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ditty-news-ticker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ditty-news-ticker/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/direct-function-for-ditty/#post-15863840)
 * Status: not resolved