I had a gallery in a D6 page.tpl.php file that worked fine by using

<?php print drupal_render('[bg|foldername]...]']; ?>

in a sidebar. I am not trying to convert the page.tpl.php for use on a D7 site. But this method no longer works. I have tried several alternatives, but none makes the block appear. All I get is the text of the tag in the block, or nothing at all. I have tried putting the tag into a block and then printing the block in the template. That produces nothing.

What is the proper method for accomplishing this?