Title: Execute shortcode in Ticker
Last modified: August 31, 2016

---

# Execute shortcode in Ticker

 *  Resolved [d.jordan](https://wordpress.org/support/users/djordan-1/)
 * (@djordan-1)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/execute-shortcode-in-ticker/)
 * Hi there,
    is it possible to execute a shortcode in the ticker?
 * What I want to do:
 * 1. Insert shortcode in ticker
    2. shortcode connects to database und pulls a 
   string 3. the string should now be visible in the ticker-output
 * I want to do this, because I dont want to insert all the content by hand and 
   want it to be stored in a database.
 * Thank you for your support 🙂
 * [https://wordpress.org/plugins/ditty-news-ticker/](https://wordpress.org/plugins/ditty-news-ticker/)

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

 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/execute-shortcode-in-ticker/#post-6917185)
 * Yes, you can add shortcodes to your ticks.
 *  Thread Starter [d.jordan](https://wordpress.org/support/users/djordan-1/)
 * (@djordan-1)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/execute-shortcode-in-ticker/#post-6917271)
 * This is somehow not really working.
    The content of the shortcode gets positioned
   outside the tick div at the start of the page that contains the shortcake of 
   the ticker.
 * I tested test[someshortcode]test. Both test-words are in the ticker but the content
   of the shortcode is still at the beginning of the page.
 * This is the Shortcode in functions.php:
 *     ```
       function get_metallpreise_content( $atts ) {
         echo "PLATIN 1.111.111 CHF";
       }
       add_shortcode( 'metallpreise', 'get_metallpreise_content' );
       ```
   
 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/execute-shortcode-in-ticker/#post-6917284)
 * Shortcodes need to return a value, not echo/print them. Please change your shortcode
   to:
 *     ```
       function get_metallpreise_content( $atts ) {
         return "PLATIN 1.111.111 CHF";
       }
       add_shortcode( 'metallpreise', 'get_metallpreise_content' );
       ```
   
 *  Thread Starter [d.jordan](https://wordpress.org/support/users/djordan-1/)
 * (@djordan-1)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/execute-shortcode-in-ticker/#post-6917285)
 * thanks this is working like a charm 🙂
 *  Thread Starter [d.jordan](https://wordpress.org/support/users/djordan-1/)
 * (@djordan-1)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/execute-shortcode-in-ticker/#post-6917286)
 * solved

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

The topic ‘Execute shortcode in Ticker’ 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

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [execute](https://wordpress.org/support/topic-tag/execute/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 5 replies
 * 2 participants
 * Last reply from: [d.jordan](https://wordpress.org/support/users/djordan-1/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/execute-shortcode-in-ticker/#post-6917286)
 * Status: resolved