• Hello wordpressers,

    I am using the Rbox theme by manish_gori.
    And need to add a vertical line after each link in menu bar.

    So I want my menubar look like this: Home | About | Contact
    I tried to place it after this line of code (header.php around line 74)

    <li class="current"><a href="<?php echo home_url(); ?>" title="Home"><?php _e( 'Home', 'Rbox' ); ?></a></li> |

    But that is only for a case where you don’t have a primary menu set.
    I think I need to do something with: $navcheck but don’t know what to do.

    Anyone some tips?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try this:

    <li class="current"><a href="<?php echo home_url(); ?>" title="Home"><?php _e( 'Home', 'Rbox' ); ?></a> | </li>

    The vertical bar has to be a part of the list item.

    But then you’ll have the problem of not showing the vertical bar after the last list item. You may be able to do this with some PHP.

    HTH

    PAE

    Thread Starter Laudde

    (@laudde)

    Thanks for your reply, but I guess it won’t work, because this piece of code is only for the case where you do not have set a primery menu (in wp-admin)

    This is de full code for the menu in header.php

    <!--menu-->
    
    		<div id="menubar" style="height: 29px;">
    
    	<?php $navcheck = '' ; ?>
    
    	<?php if (function_exists( 'wp_nav_menu' )) {
    		$navcheck = wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary', 'menu_class' => 'dropdown dropdown-horizontal reset' ,'fallback_cb' => '', 'echo' => false ) );
    	} ?>
    
    	<?php  if ($navcheck == '') { ?>
    
    	<ul class="dropdown dropdown-horizontal reset">
    		<li class="current"><a href="<?php echo home_url(); ?>" title="Home"><?php _e( 'Home', 'Rbox' ); ?></a></li> | 
    
    <?php
    
    				if(get_option('rb_menu_bar') == 'true'){
    					wp_list_pages('title_li');
    				}
    		?>
    
    		<?php
    				if (get_option('rb_cat_bar') == 'true'){
    					wp_list_categories('title_li');
    					}
    		?>
    
    	</ul>
    <?php } else echo($navcheck); ?> 
    
    	</div>
    
    	<!--menu end-->

    I think we need a link, if at all possible, if we’re going to be able to comment sensibly further.

    Cheers

    PAE

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Menubar with spacers between links’ is closed to new replies.