Title: Using PHP and shortcode at the same time (resolved)
Last modified: August 19, 2016

---

# Using PHP and shortcode at the same time (resolved)

 *  Resolved [mthrwdwn](https://wordpress.org/support/users/mthrwdwn/)
 * (@mthrwdwn)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/using-php-and-shortcode-at-the-same-time/)
 * I am adding shortcodes to my wordpress templates, and in the shortcode i would
   like the value to echo after the wordpress title:
 * **<?php echo do_shortcode(‘[ti_audio name=”Value”]’); ?>**
 * I wanted something that would function like:
    **<?php echo do_shortcode(‘[ti_audio
   name=”<?php the_title() ?>”]’); ?>**
 * How would I go about doing something like this? The original shortcode is:
    **[
   ti_audio name=”Name of Playlist”]**
 * And the Name of playlist, I want to be the exact same name as the title of the
   post. Is this possible?
 * I am using this plugin/these shortcodes:
    [http://tierra-innovation.com/wordpress-cms/2009/10/16/audio-playlist-manager/](http://tierra-innovation.com/wordpress-cms/2009/10/16/audio-playlist-manager/)

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

 *  [Darrell Schauss](https://wordpress.org/support/users/darrellonsite/)
 * (@darrellonsite)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/using-php-and-shortcode-at-the-same-time/#post-1498897)
 * You dont start `<?php` over again when inside php code already. More like this.(
   not tested). `the_title` will echo the title right away. `get_the_title` allows
   you to store and use the value.
    `<?php echo do_shortcode('[ti_audio name="'.
   get_the_title($post->ID).'"]'); ?>`
 *  Thread Starter [mthrwdwn](https://wordpress.org/support/users/mthrwdwn/)
 * (@mthrwdwn)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/using-php-and-shortcode-at-the-same-time/#post-1498901)
 * Thank you,
    I had figured that you cannot restart the php but i was having trouble
   figuring out how to display “the title”
 * previously, i had tried to use:
    `<?php echo do_shortcode('[ti_audio name="'.
   $thetitle.'"]'); ?>`
 * but it was not working.
 * thank you for your help!

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

The topic ‘Using PHP and shortcode at the same time (resolved)’ is closed to new
replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [mthrwdwn](https://wordpress.org/support/users/mthrwdwn/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/using-php-and-shortcode-at-the-same-time/#post-1498901)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
