Title: Direct Function
Last modified: January 29, 2022

---

# Direct Function

 *  Resolved [Webamaze](https://wordpress.org/support/users/webamaze/)
 * (@webamaze)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/direct-function/)
 * With the previous version of Ditty I inserted the direct function code into my
   header.php:
 * `<?php if(function_exists('ditty_news_ticker')){ditty_news_ticker(17727);} ?>`
 * This doesn’t seem to be available with the new version so I am still using the
   legacy version of Ditty.
 * Will this be made available for the next update please?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/direct-function/#post-15305350)
 * This can be done with the new Ditty using:
 *     ```
       <?php
       if ( function_exists( 'ditty_render' ) ) {
         echo ditty_render( array( 'id' => DITTY_ID_HERE ) ); 
       }
       ?>
       ```
   
 * The reason this is not featured with Ditty is that there is now a **Global Ditty**
   option that allows you to insert a Ditty anywhere on your site without having
   to use a direct function. Go to **Ditty > Settings > Global Ditty**. You do need
   provide and HTML selector that tells the code where to place the Ditty, but other
   than that you just select your Ditty and it’ll appear on your site. Here is a
   quick screencast I made showing how to do this: [https://www.loom.com/share/b358fc4c3d364d5db4db7bd9dffc28a8](https://www.loom.com/share/b358fc4c3d364d5db4db7bd9dffc28a8)
 * Let me know if you have any other questions. Thanks!
 *  [p2monaco](https://wordpress.org/support/users/p2monaco/)
 * (@p2monaco)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/direct-function/#post-15384419)
 * I installed new Ditty but still running legacy. I have the following code in 
   the file…
    Total Child: Theme Header (header.php). Which was copied from “Direct
   Function” that is displayed when editing legacy ticks. Can you tell me the steps
   for deactivating legacy Ditty and begin using the new version of Ditty and still
   have the ticks appear on the top of every page on my site [http://www.lppcmin.org/](http://www.lppcmin.org/).
   I do not understand how to find the HTML element needed for the new Ditty Global
   Settings.
 * `<head>
 *  <?php if(function_exists(‘ditty_news_ticker’)){ditty_news_ticker(426);} ?>
 * <meta charset=”<?php bloginfo( ‘charset’ ); ?>”>
    <link rel=”profile” href=”[http://gmpg.org/xfn/11″&gt](http://gmpg.org/xfn/11″&gt);
   <?php wp_head(); ?> </head>
 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/direct-function/#post-15386898)
 * To disable Ditty News Ticker got to **Ditty > Settings > Advanced** and uncheck
   the **Enable Ditty News Ticker (Legacy code)** checkbox. The menu item for News
   Tickers will be removed the next time the page is refreshed.
 * You will still need to manually remove the legacy DNT code you have added to 
   your header.php file after this.
 * I checked out your site and you should use the following in the **HTML Selector**
   field for a Global Ditty: **#outer-wrap**
 * Then select **Before Element** as the **Position** of the Ditty.
 * Choose the **Ditty** you want to use and then **Save Settings**. That should 
   be all you have to do.
 * Let me know if you have any further questions.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Direct Function’ 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/)

## Tags

 * [ditty](https://wordpress.org/support/topic-tag/ditty/)
 * [head](https://wordpress.org/support/topic-tag/head/)
 * [legacy](https://wordpress.org/support/topic-tag/legacy/)

 * 3 replies
 * 3 participants
 * Last reply from: [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/direct-function/#post-15386898)
 * Status: resolved