21st Nov '22
/
8 comments

Centered Image Logo in Bricks

Updated on 8 Mar 2023

This Pro tutorial provides the steps to add a logo image as the center menu item that shrinks when the header becomes sticky in Bricks.

Step 1

At Appearance → Menus create (if needed) and edit your main/header menu.

Click "View All" in the Pages accordion on the left and click "Home - Front Page".

Drag the Home menu item in the center with other menu items around it.

Step 2

Let's add support for theme logo so that logo can be set in the Customizer.

Add this in child theme's functions.php or a code snippets plugin:

// Add theme support for custom logo add_theme_support( 'custom-logo' );

Go to Appearance → Customize → Site Identity and select/upload your logo image.

If you'd like to follow along, you could upload this image.

Click Publish.

Step 3

Edit your Header template with Bricks.

Add a Section and inside its Container, a Nav Menu element.

If there is more than 1 menu in your site, select your main/header menu.

By default nav menu list items have a left margin value of 15px.

A better way to space out the items is to set left and right padding for the anchor elements (the actual links) inside the li elements.

Under the TOP LEVEL MENU control group set left Margin to 0 and set left and right Padding to 15.

If you'd like the header to be a sticky, click the Settings (gear) icon → TEMPLATE SETTINGS → HEADER.

Enable (the controls are technically checkboxes, so "tick" would be the correct verb) Sticky header and Sticky on scroll.

In my test site, I set Scrolling background to #ffffff.

Scrolling box shadow: 0, 4, 16, 8 with a Color of RGBA 33, 33, 33 and 0.1.

Step 4

Now for the fun part.

Let's loop through the nav menu objects and for each, check if the menu title text matches Home and if so, replace it with the HTML of the custom logo image.

Add this in your child theme's functions.php or the code snippets plugin:

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 610 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
New Ribbon for Posts in Bricks

New Ribbon for Posts in Bricks

This Pro tutorial provides the steps to display a "New" ribbon for posts that were published in the last x days in Bricks. Update: Added…
Categories:
Tags:
How to add SVG icon as list item bullets

How to add SVG icon as list item bullets

Add this sample CSS: Replace brxe-list with the class of your ul element. Here's how you can generate the value of background-image property: Copy your…
Categories:
Tags:
Pro
“Pro” Category Ribbon for Posts in Bricks

“Pro” Category Ribbon for Posts in Bricks

This Pro tutorial provides the steps to show a "Pro" ribbon for posts that are categorized under the "Pro" category when using Bricks builder. Step…
Categories:
Pro
Dropdown Menu in Bricks using Interactions

Dropdown Menu in Bricks using Interactions

This Pro tutorial provides the steps to toggle a WordPress menu when a div is clicked using the Interactions feature in Bricks. When clicked: Step…
Categories:
Pro
Top Bar Above Sticky Header in Bricks

Top Bar Above Sticky Header in Bricks

How to set up a top bar above sticky header in Bricks Builder so only the header remains sticky when scrolling.
Categories:
Tags:
Pro
Sticky Scrolling in Bricks Builder

Sticky Scrolling in Bricks Builder

Updated on 22 Apr 2024 This Pro tutorial provides the steps to fix elements in the viewport i.e., make them sticky while adjacent content in the section…
Categories:
Tags:
Pro
Search Results Template in Bricks

Search Results Template in Bricks

Updated on 26 Oct 2023 This Pro tutorial provides the steps to set up a search template in Bricks with these features: Step 1 Create…
Categories:
Width and Height of Mobile Hamburger Toggle in Bricks

Width and Height of Mobile Hamburger Toggle in Bricks

Looking to change the size of Bricks hamburger toggle in the mobile menu? The default width value of 20px can be changed by selecting the…
Categories: