In Drupal 6, it was easy to insert a block into a template with the following code:
$block = module_invoke('views', 'block', 'view', 'block_name');
print $block['content'];
However, using the same instructions in Drupal 7 does not seem to work. I have looked around and cannot find the new method.
Does Drupal 7 have a routine that can allow for programmatically inserting a block into a template or node?
This appears to be the solution for inserting blocks into templates for Drupal 7, but it seems a bit clunky and I have no idea about impact on performance:
If anyone has a better procedure, please do add.
Improving wrburgess' answer, you can do it in one line...
So for example, I use block number 6...
Just tested this in drupal 7 and it works:
Good luck!
Have a look how Drupal does it in _block_render_blocks. The result of that function gets passed to drupal_render.
With wrburgess's answer you may get an error if your server is using a newer version of PHP.
This is what I did to not cause/get rid of the error.
This works for me for printing menu block.