I want to introduce a custom theme function in my theme. Typically, I would register a theme in hook_theme() in a module, but I want to define this function from my theme (Omega 4). In whatever module I'm in, I'd like to just build my render array and let it be themed by the theme-side theme function.


$ra = array(
    '#theme' => 'my_theme_fx',
    '#somevar' => 'foo',
    '#anothervar' => 'bar'

1 Answer 1


The description of hook_theme() is:

Register a module (or theme's) theme implementations.

So you can implement this hook in your theme.

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.