30th Oct '24
/
2 comments

Bricks Query Loop Cards with Hover Image

Bricks Query Loop Cards with Hover Image

Updated on 5 Nov 2024

This Pro tutorial shows how images uploaded to posts as the value of a 'Hover Image' field can be set to appear when the featured images in a Bricks posts query loop are hovered.

Step 1

[Optional] Let's register a new image size for the images.

Add the following in child theme's functions.php (w/o the opening PHP tag) or a code snippets plugin:

<?php add_image_size( 'project-image', 682, 430, true );

where project-image is your custom image size handle.

Step 2

Add a new field group for your post type having an image-type custom field named say hover_image.

Add/edit posts and set the hover image for each.

Step 3

Edit the single template for your post type with Bricks.

Copy the JSON of the fully-built Section from the link below and paste.

Note: ACSS classes are used.

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 625 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Floating Bottom Div when Scrolling Down in Bricks

Floating Bottom Div when Scrolling Down in Bricks

Creating a floating call to action element that reveals only as the user scrolls down.
Categories:
Tags:
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
Stacking Post Cards in Bricks

Stacking Post Cards in Bricks

How we can stack posts in a query loop so they stick on top of the previous one when scrolling.
Categories:
Tags:
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
Horizontal Scrolling Sections in Bricks Using GSAP’s ScrollTrigger

Horizontal Scrolling Sections in Bricks Using GSAP’s ScrollTrigger

In this Pro tutorial we'll use GSAP's ScrollTrigger library in Bricks to create a section that will scroll horizontally across a number of full width…
Pro
CSS Grid for Posts Element in Bricks

CSS Grid for Posts Element in Bricks

The "Posts" element in Bricks has "Grid" as the default layout but the actual CSS it applies on the page feels hacky with negative margins…
Categories:
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: