• Resolved mthrwdwn

    (@mthrwdwn)


    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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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

    (@mthrwdwn)

    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.