How to add a new widget area into a specific div in functions.php
-
I used the following code to achieve a new div above the header.
function pagetopwidget() { echo '<div id="pagetopwidget"> </div>'; }
I have registered a new widget ‘Top Page Widget’
But how do I insert the widget in to the above code so it will appear in that div?
I tried to insert in this code between the <div> tags but no luck, maybe missing some important piece of php.
<?php if (!dynamic_sidebar('Top Page Widget')) : ?> <div class="toppagewidget"> <div class="wrap"> <p><?php _e("This is a widgeted area which is called Top Page Widget"); ?></p> </div><!-- end .wrap --> </div><!-- end .widget --> <?php endif; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to add a new widget area into a specific div in functions.php’ is closed to new replies.