Created
June 19, 2014 03:06
-
-
Save rahularyan/f84742c8eac0f36fd9ca to your computer and use it in GitHub Desktop.
Add custom widget positions in qawork
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// register position name | |
qw_apply_filter('widget_positions', 'qw_register_widget_positions'); | |
function qw_register_widget_positions($positions){ | |
$new_positions = array( | |
'My Custom Position' => 'Below header', | |
'My Custom Footer' => 'Custom footer position', | |
); | |
return array_merge($positions, $new_positions); | |
} | |
// add position in theme layer, or use theme layer action | |
if($this->qw_position_active('My Custom Position') ){ | |
$this->output('<div class="custom-position-outer"><div class="container">'); | |
$this->qw_position('My Custom Position'); | |
$this->output('</div></div>'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment