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..

How to create filters with IsotopeJS in Bricks (Part 1)

How to create filters with IsotopeJS in Bricks (Part 1)

This tutorial series will explore the IsotopeJS library's features inside the Bricks ecosystem.
Categories:
Pro
Accordion Grid Query Loop in Bricks

Accordion Grid Query Loop in Bricks

How to set up a accordion in Bricks such that the "titles" are arranged in a grid with the full width content opening below.
Categories:
Pro
Click-type Infinite Scroll in Bricks Builder

Click-type Infinite Scroll in Bricks Builder

This Pro tutorial provides the steps to set up "click to load more" posts using Infinite Scroll JS in Bricks builder. Step 1 Edit your…
Categories:
Floating Element in Bricks

Floating Element in Bricks

How to create a floating element in Bricks that appears across the entire website.
Categories:
Tags:
How to create filters with IsotopeJS in Bricks (Part 4): AJAX filter and infinite loops, Sorting, List view and Disable animations

How to create filters with IsotopeJS in Bricks (Part 4): AJAX filter and infinite loops, Sorting, List view and Disable animations

This tutorial will explain how to enable the AJAX filter with an infinite scroll query loop container, how to add a sorting function, how to…
Categories:
Pro
tsParticles in Bricks

tsParticles in Bricks

Updated on 5 Aug 2023 This Pro tutorial provides the steps to set up tsParticles, a lightweight TypeScript (uses JavaScript) library for creating particles as…
Categories:
Pro
Fixed Sidebar Layout in Bricks

Fixed Sidebar Layout in Bricks

A user asked: This Pro tutorial provides the steps to set up a fixed left (or can be on the right) sidebar using hooks and…
Categories: