Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to add the upload file plugin shortcode to a custom post type for a client build (if there's a better way to do this, please tell me). Basically I've got this -

echo '<p>Description:</p>';
echo '<input type="text" name="_Description" value="' . $Description . '" class="widefat" />';
echo '<p>Requirement:</p>';
echo '<input type="text" name="_Requirement" value="' . $Requirement . '" class="widefat" />';
echo '<p>Solution:</p>';
echo '<input type="text" name="_Solution" value="' . $Solution . '" class="widefat" />';
echo '<?php do_shortcode("[inline_upload]"); ?>';

this doesn't throw any errors on the page but the outputted is

<!--?php do_shortcode("[inline_upload]"); ?-->

Is it possible to add a shortcode to a custom post type? Is there an easier, cleaner way to do this?

Thanks in advance

edit:

The code is in a custom post type file that I'm calling via the functions.php to be part of the menu system. Clicking add new to it creates all the forms but outputs the

I guess I'm doing it wrong?

share|improve this question
    
Where is that code? Are you typing that PHP into the backend editor? –  s_ha_dum Oct 17 '13 at 13:44
    
"The code is in a custom post type file that I'm calling via the functions.php to be part of the menu system." - this isn't making sense to me. Where exactly is this code being called (and output)? In a template file? In a callback to some hook? And how is it added to the menu system? –  Chip Bennett Oct 17 '13 at 14:01
add comment

1 Answer

up vote 0 down vote accepted

If I understand this correctly it looks like

echo '<?php do_shortcode("[inline_upload]"); ?>';

should be echo do_shortcode("[inline_upload]");

So that it actually runs the short code instead of echoing the code.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.