How to put a Wordpress widget inside a bootstrap navbar? -
i making first wordpress theme using bootstrap. want create widget area in far right of navbar, can add ie. language selector. tried following code, nothing appears on site, or in source code widget should be. ideas?
<div class="navbar navbar-inverse navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <div class="row"> <div class="span8"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="brand" href="<?php echo site_url(); ?>"><?php bloginfo('name'); ?></a> <div class="nav-collapse collapse"> <ul class="nav"> <?php wp_list_pages(array('title_li' => '', 'exclude' => 4)); ?> </ul> </div><!--/.nav-collapse --> </div> <div class="span4 navbar-right"> <?php dynamic_sidebar( 'right-top' ); ?></div> </div> </div> </div> </div> </div>
code registering sidebars in functions.php
if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'right top', 'id' => 'right-top', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h3>', 'after_title' => '</h3>', ));
when call register_sidebar
use name right top
, id hoyre-top
call dynamic_sidebar
name/id right-top
isn't id of sidebar.
try
<div class="span4 navbar-right"> <?php dynamic_sidebar( 'hoyre-top' ); ?></div> </div>
or change id of sidebar in register_sidebar
hoyre-top
right-top
.
Comments
Post a Comment