Blocks are the boxes of content (such as "User Login" or "Who's online") that can be displayed in regions (such as footer or sidebar) on your page. Blocks are made available to your site most commonly by enabling modules. Once created, a Block can be modified to adjust its appearance, shape, size and position - or which Website pages it appears on. There are some cases where you want to render block within content of page or part of node body. Here is sample code to render the blocks programmatically in Drupal 7. Rendering Custom blocks (created through block UI):
<?php
  $block = block_custom_block_get('BLOCK_ID'); // e.g. 2
  print $block['body'];
?>
The Block API function block_custom_block_get takes one argument i.e. BLOCK_ID which is the ID of the block to get information for. Rendering core/contributed/custom modules blocks:
<?php
  $block = block_load('node', 'recent');
  $render_array = _block_get_renderable_array( _block_render_blocks( array($block) ));
  print render($render_array);
?>
The above code renders the block "recent" defined by core "node" module.

Reference:

Submitted by ychaugule on