I'm attempting to render a specific block on a page without rendering the region. I'm assuming the machine name of the block is 23 based on the URL I get when configuring the block.


I'm attempting to grab the block using the information I've found here


My attempt at it is

$block = module_invoke('block','blockview',23);
print render($block['content']);

But I'm not having any luck.

  • 2
    possible duplicate of Printing a block in node.tpl.php
    – Yuseferi
    Commented Aug 27, 2015 at 16:54
  • -1 from me, because themes should never require certain blocks to be available, or modules enabled. Rendering region is the designed way to do it and shortcuts like this may hurt future developers.
    – Mołot
    Commented Aug 27, 2015 at 17:05

1 Answer 1


Almost there it's block_view not blockview

$block = module_invoke('user', 'block_view', '2');
print render($block['content']);
  • oh wow, I was a lot closer than I realized. Thanks!
    – Amy
    Commented Aug 27, 2015 at 16:49
  • Glad it helped, would you make the question as answered.
    – sam2de
    Commented Aug 27, 2015 at 16:55
  • 1
    Yep sorry, I tried to check it right after you answered but it told me I had to wait a bit.
    – Amy
    Commented Aug 27, 2015 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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