61 thoughts on “Center Header Block Items (3.1/3.2)

  • Reply

    Hey Dave,

    This snippet centre is awesome! Thank you so much for putting all of these tips here.

    I was wondering if you could help me out with the header? I want to have the logo and menu line up with the width of the rest of the front page but have no idea where to start. Could you perhaps give me some pointers? I’ve only just started building my site and I’m trying to learn CSS but I’ve no idea which tags to look for within the code.

    Many thanks again,


  • Reply

    Hi everyone, I wonder if you can help…. I can’t find it listed unless I’ve missed it. I love this theme but can’t quite get my head around why the logo is above the menu bar, it seems to be on the same horizontal space as the menu on all of the other sites with the customizr theme. Am I missing something and can this be resolved with a snippet?

    Thanks in advance.


  • Reply

    Hi :-)

    I was wondering if I could center the menu below a large image in the header with this theme. I’d love to continue using this for various website!!

    I found this snippet but it appears it centers the items within the navbar vs. centers the navbar – am I understanding wrong?

    http://www.jeanneesti.com/test is where I’m starting to work (STARTING being the keyword for this one!)

    • Reply
      Dave Bardell Post author

      Most of these Snippets are tested standalone, so it is possible that when added to other CSS code they don’t work quite as intended. I’d suggest the Forum would be a better place to get a solution for this, and include a link to your Site.

      Cari, I recognise you from the Forum so I hope you resolved this!

      Thanks for using Customizr.

  • Reply
    Katie Sutton

    Hi, thanks for this snippet and all of them! Very helpful. However, I notice that adding the PHP snippet to remove the span 9 seems to cause the “Go Home” hyperlink functionality of the logo to stop working. Any way we can get that back and still have a centered menu?

      • Reply

        Hi – Thanks Dave – I do have a lot of custom CSS so that well could be, although as soon as I take the new Span 9 function out it works again. Is there a way to send you a link privately? Site is for a client and they do not want it public yet.

        • Reply

          Hey Katie, it you still have this problem in version 3.2. I had the same problem and solved it by setting .navbar-wrapper from position: relative back to position: static. Perhaps this helps.

  • Reply


    Is it possible to get the navbar on 100% width?
    Because the right site of the navbar keeps on getting a white background.
    I want to get it from left to right with a grey background or image.
    Which code can I use in my child theme?


    • Reply
      Dave Bardell Post author

      Change the function.php above which removes span9 from navbar-inner to:

  • Reply

    I have installed a plugin that has messed up the way the menu renders. I believe it is because of the order that the references are now populated in the header. For the life of me I can’t find the function that is used to created the tags so I can reorder them. Any help you can provide is greatly appreciated.


  • Reply

    Thanks for getting back to me so quickly Dave. To anyone who has the same problem I was having, we figured out that there was an overlapping Div that must have been blocking the link to “back home” embedded under the logo. I used this css to fix it:

    This is a great theme and appreciate the support!

  • Reply

    I have created a Child Theme, and the parent theme is running the 3.0.15. Now, from the snippets above, I used the one titled 3.0.14 update in the functions.php file within the child theme directory.

    1. The logo is centered but this center alignment is not perfect. Please check here: http://projectparampara.com
    2. Also, the menu is not center aligned. It is still left aligned.

    Please suggest a way to solve these two issues.

    • Reply
      Dave Bardell Post author

      Had latency problems accessing your site, leading to Firefox crashing. I did see your site briefly. There was no logo loaded, and a blank menu/navbar.

      I’d suggest the Forum would be a better place to get a solution for this, with a much wider audience to help fix problems. And please include a link to your Site.

  • Reply

    Hi everyone,
    first of all: my compliments for a superb theme. And also for the above snipet, just what the doctor ordered!
    The only problem that I am facing with it: is that I want to have vertical lines between the menu items. I’d figured a simple border-left and border-right would do the trick. But I have been trying to apply that to all css classes that I could imagine had something to do with it, but NO luck. I am getting desperate.
    Most logically, I had thought it would need to be applied to ‘.navbar .nav > li > a’. But that doesn’t work.
    Can anyone help? Which CSS class would I need to put borders on?
    Many thanks!

  • Reply

    Hi, I created my own css class for a right border so that I could apply it to ONLY the first three items on my menu and not the last one (because it looks weird to have a right-border after the last item, at least on my design).

    This theme has a great feature in the Appearance>Menus section of the Dashboard where you can apply CSS directly to an individual menu item (just make sure you select CSS classes in “Show advanced menu properties” in Screen Options tab at the top of your Dashboard). So just create your new class in your child theme css and then add that class to the CSS Class window for the relevant menu items.

    You’ll have to adjust the class back to remove the border for screen sizes below 979px if you don’t want borders on your mini-menu.

  • Reply
    Cherie Benjamin

    Just as a note in the functions.php above there is an extra curly bracket at the end that when someone copies and pastes the code it renders the theme not to work.

    • Reply
      Dave Bardell Post author

      Thanks to @If designs (daniel) for pointing out error in Step 1.

      Thanks to @Norman Fetter for pointing out error with Social Icons (Still under investigation – a weird one!). I’ve highlighted the code to avoid until fixed.

  • Reply

    This worked perfectly for me, with 1 tiny exception:

    All of the other functions in my dashboard are fine except for the “customize” option – I get an internal server error. I don’t know enough about php to be able to troubleshoot (besides removing all of the code mentioned above). I did have a bit of code already in my child functions.php file – could there be some conflict?


  • Reply

    Thanks for this fix Dave! Everything worked for my navigation but I’m having trouble getting my logo to be centered and enlarged. I created a child theme and I think I copied the code into the right place [Appearance >> Editor] but it’s still not working. I know very little about HTML and CSS so I appreciate the help!

    My site: oneelevenmissoula.com

    • Reply
      Dave Bardell Post author

      Hi Kelsi, it looks like you fixed your problem?

      If not, I’d suggest the Forum would be a better place to get a solution for this, with a much wider audience to help fix problems. And please include a link to your Site.

  • Reply
    Keith Brodie

    Is there a code snippet. or place to adjust the navbox/header re-alignment characteristics? Specifically, everything looks great, but when you resize the screen slightly smaller, or use the zoom function to app. 125%, the navbox drops and there is a gap between it and the top of the screen. Yet the logo and social icons stay up at the top. here’s my site for reference: http://www.pmtrainingclass.com

    • Reply
      Dave Bardell Post author

      Hi Keith.

      You need to add some @media code to make any adjustments you need. See this Snippet for more information.

      If still stuck, I’d suggest the Forum would be a better place to get a solution for this, with a much wider audience to help fix problems. And please include a link to your Site.

  • Reply

    SO this super rad code works BUT I’m getting a couple of errors.

    Using just this code:

    And receiving these errors:

    Is this because of an update maybe? The parent theme is fresh and unedited..

    Any help would be *greatly* appreciated :)

  • Reply
    Briana Reese

    I need a brain that is smarter than mine- please :)

    Put this in my child themes functions.php:

    And I’m getting this rad error now:

    I’m wallowing in pitiful right now, please help <3

  • Reply

    I understand how to copy and paste but where do I find the
    Child Theme style.css ?? Can anyone give me easy instructions on how to change the style.css I want to center my menu items! please help!

    • Reply

      Hi Dana,
      if you need to make minor CSS changes to your website, you may consider using the custom CSS feature.
      in your WP admin, navigate to Appearance > Customize > Advanced Options > Custom CSS
      Then copy your CSS code here and it will be instantly applied to your website preview.
      Hope this helps!

  • Reply
    Sean K Young

    I am now getting the implode error on tc_logo_class

    add_filter( 'tc_logo_class', 'rdc_logo_class' );
    function rdc_logo_class() {
    return 'brand span12';

  • Reply

    I followed this and it doesn’t seem to do anything on the live site. Strangely if I go to customize in Appearance the menu shows as centered in there. It just doesn’t show centered on the live site.

  • Reply

    Thank you for this great theme. It’s my favorite one.
    I just have one thing I can’t manage. And that’s to centre the menu without a logo. So I don’t want the logo at the menubar, but I see there some space for it. On a 13” it looks ok but on a widescreen it doesn’t.
    I hope you can help me.

  • Reply

    I tried this filer with version 3.3.26 and I’ve noticed that function tc_set_logo_title_layout override the parameters $_classes sent to the function.

  • Reply

    hi, i coded like this snippet says but, if you have the browser page at 1200px of weight the menu is correctly centered but if i resize the windows to a 1920px width the menu … slides a bit to the left… am i doing anything wrong?


Leave a Comment

Your email address will not be published. Required fields are marked *

Please check the following point before adding your comment

  1. - Did you check that you have the latest version the theme installed ?
  2. - Did you read the documentation ?
  3. - If you think it could be useful, please check your system informations : Navigate to Appearance > About Customizr and go to the bottom of the page.
  4. - Did you check if your issue was already resolved ? Before posting a new topic, you'll want to make a quick research with our Google powered search tool below.

You may also use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">