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.

hey guys, The "mingle forum plugin" provides the following shortcode [mingleforum]. When I paste this into a page the forum is shown.

My forum is using a specific page-template called forum.php. Is it possible to already include this shortcode in the page-template itself, so I don't have to paste it in the wordpress backend anymore. So that when I use the forum.php page template the forum is always automatically embedded?

Thank you for your tipps and info.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

To use shortcode in a PHP file (outside the post editor) you have the handy little function do_shortcode();

so in your case you use:

<?php
do_shortcode('[mingleforum]');
?>

Update:

following the first comment, I figured its publicly known for some reason,

if you are expecting output from the shortcode then echo it out.

<?php
echo do_shortcode('[mingleforum]');
?>
share|improve this answer
    
thank you! I had to do echo do_shortcode, but it worked! –  mathiregister Mar 13 '11 at 17:23
    
updated for future lurkers :) –  Bainternet Mar 13 '11 at 17:46
    
Thank you for the tip! –  FOR Apr 24 '11 at 17:06

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.