How to Create a Sticky Audio Content Bar in Divi

Last Updated on September 17, 2022 by 1 Comment

How to Create a Sticky Audio Content Bar in Divi
Blog / Divi Resources / How to Create a Sticky Audio Content Bar in Divi

Adding a sticky audio content bar is a great way to feature an audio clip for easy access as a user scrolls through your page content. For example, podcasters can “stick” their featured audio at the top of an episode page so the user can always have access to those audio controls while listening and engaging with the rest of the page content.

In this tutorial, we are going to get a bit creative with Divi and its built-in sticky position options to build a sticky audio content bar in Divi. We’ll to show you how to convert existing audio content on a page (like a row with an audio module) into a sticky audio content bar that stays at the top of the window once the user passes up the audio content while scrolling. Plus, we’ll also show you how to change the content, style, and layout of the bar once the sticky state is engaged (or stuck at the top of the window). The smooth transition and functionality of this design offers a unique solution for showcasing audio content on any Divi website.

Let’s get to it!

Sneak Peek

Here is a quick look at the design we’ll build in this tutorial.

Here is a look at the transition of the audio content into a sticky audio content bar.

And here is a look at how one might engage with the audio bar while scrolling through the page.

Download the Layout for FREE

divi sticky audio content bar

To lay your hands on the designs from this tutorial, you will first need to download it using the button below. To gain access to the download you will need to subscribe to our newsletter by using the form below. As a new subscriber, you will receive even more Divi goodness and a free Divi Layout pack every Monday! If you’re already on the list, simply enter your email address below and click download. You will not be “resubscribed” or receive extra emails.

To import the section layout to your Divi Library, navigate to the Divi Library.

Click the Import button.

In the portability popup, select the import tab and choose the download file from your computer.

Then click the import button.

divi notification box

Once done, the section layout will be available in the Divi Builder.

Let’s get to the tutorial, shall we?

What You Need to Get Started

expanding corner tabs

To get started, you will need to do the following:

  1. If you haven’t yet, install and activate the Divi Theme.
  2. Create a new page in WordPress and use the Divi Builder to edit the page on the front end (visual builder).
  3. Choose the option “Build From Scratch”.

After that, you will have a blank canvas to start designing in Divi.

Part 1: Upload the Podcast Premade Layout Pack from the Divi Builder

To jumpstart the design of our sticky audio bar in Divi, we will use the premade podcast landing page layout. From the settings menu, select the “Load From Library” plus icon. Then find the podcast landing page layout and load it to the page.

divi sticky audio content bar

Part 2: Creating the Sticky Row to Hold the Audio Content

At the very top section of the premade layout, find the row inside that top section. Then add a new one-column row below the existing row.

divi sticky audio content bar

divi sticky audio content bar

Row Settings

Before adding any modules, open the settings for the new row and update the following:

  • Gutter Width: 1
  • Width: 100%
  • Max Width: 100%
  • Padding (desktop): 10px top, 10px, bottom, 10% left, 10% right
  • Padding (tablet and phone): 10px top, 10px, bottom, 10px left, 10px right

divi sticky audio content bar

To make the row sticky, go to the advanced tab and update the following:

  • Sticky Position: Stick to Top

This will cause the row (soon to be our audio content bar) to stick to the top of the browser window when scrolling down the page.

divi sticky audio content bar

Part 3: Adding the Audio Content

Adding the Audio Module to the Row

Next, move/drag the existing (pre-designed) audio module from the first row in the top section into the new row you just created. This will serve as the featured audio that we will include inside the sticky audio player

divi sticky audio content bar

Adding a CTA Using a Blurb Module

Next, we will create a CTA that will show on the right side of our sticky audio content bar.

To create the CTA, copy the blurb module with the play icon in the top section of the layout.

divi sticky audio content bar

Then, paste the duplicate blurb module under the audio module in the second row of the top section.

divi sticky audio content bar

Part 4: Styling the Audio Content

Styling the Audio Module

Once the row inherits the sticky position, we want to have different styling for our audio module. To do this, open up the settings for the audio module and update the following sticky state options:

  • Title Text Size (sticky): 14px
  • Title Line Height(sticky): 1.3em
  • Caption Line Height (sticky): 1.3em

All this does is shrink the text and spacing a bit so that the audio content doesn’t take up much vertical space in our sticky bar.

divi sticky audio content bar

Next, we want to change the width of the audio module in the sticky state as follows:

  • Width (desktop): 80%
  • Width (sticky): 100%
  • Max Width (sticky): 100%

divi sticky audio content bar

Next, we need to adjust the spacing of the audio module as follows:

  • Margin: 0px top, 0px bottom
  • Padding: 0px top, 0px bottom, 0px left, 20px right

divi sticky audio content bar

Finally, we need to add a few custom CSS snippets under the advanced settings in order to left-align our text and add unique colors to our audio player button and slider.

Add the following CSS to the Audio Title only under the sticky tab:

text-align:left;

Add the following CSS to the Audio Meta only under the sticky tab:

text-align:left !important;

Add the following CSS to the Player Buttons only under the sticky tab:

color: #fe4943;

Add the following CSS to the Player Sliders Current only under the sticky tab:

background: #2c4ca3;

divi sticky audio content bar

Styling the Blurb CTA

Next, we are going to style our blurb module that is going to serve as a mock CTA to view all episodes.

First, add the text “All Episodes” to the body content of the blurb.

divi sticky audio content bar

Under the design tab, update the following:

  • Body Font: Lato
  • Body Font Weight: Bold
  • Body Font Style: TT
  • Body Text Size: 10px
  • Body Letter Spacing: 2px
  • Body Line Height: 1.3em

divi sticky audio content bar

Then adjust the size of the blurb icon:

  • Icon Font Size: 50px

divi sticky audio content bar

Then adjust the size of the module as follows:

  • Content Width: 100%
  • Width: 20%

divi sticky audio content bar

Now go back to the content tab and add a background for the blurb as follows:

  • Background Color: #1a1844
  • Background Image: [add image]
  • Background Image Blend: Luminosity

divi sticky audio content bar

We want this module to be hidden initially from view until the row reaches the sticky state and the audio control bar is stuck at the top of the window. To do this, we can add a few snippets of css that hide the module on desktop and show the module in the sticky state.

Under the Advanced tab, update the following custom CSS:

Main Element CSS (desktop):

display:none;

Main Element CSS (sticky):

display:block;

Blurb Image CSS:

margin-bottom: 10px

divi sticky audio content bar

Part 5: Changing the Alignment of Audio Bar Content in the Sticky State

Right now the sticky row has only one column with two modules stacked on top of each other. So the sticky bar would show the CTA blurb below the audio module. This would take up too much vertical space for a sticky bar and wouldn’t look very nice.

To make sure everything is horizontally and vertically aligned within the column, we. can use the CSS flex property to adjust the layout of our modules in the sticky state.

To do this, open the settings for the column containing both modules.

Under the advanced tab, add the following custom CSS to the Main Element

Main Element (desktop):

display:flex;
flex-direction:column;

Main Element (sticky):

display:flex;
flex-direction: row;
align-items:center;
justify-content:center;

divi sticky audio content bar

That’s it! Let’s review the results.

Final Result

Here is the design on desktop once the row is in the sticky state.

divi sticky audio content bar

And here is the design on mobile.

divi sticky audio content bar

And here is a few video clips of how the audio content sticky bar magic works on a live page.

Final Thoughts

Divi’s sticky position options can be a powerful tool for web designers. In this tutorial, we showed you how to create a sticky audio content bar using Divi’s sticky styling options in advanced and creative ways. One of the unique techniques featured in this tutorial was how to align the content of a sticky row using the flex property. Thankfully, Divi’s has a convenient way to adding custom code snippets to the sticky state using the advanced custom CSS blocks to give us the design flexibility we needed. Hopefully, this will give you some inspiration for creating one on your next project.

I look forward to hearing from you in the comments.

Cheers!

Divi Marketplace

Are You A Divi User? Find Out How To Get More From Divi! 👇

Browse hundreds of modules and thousands of layouts.

Visit Marketplace
Divi Marketplace
Divi Cloud

Find Out How To Improve Your Divi Workflow 👇

Learn about the new way to manage your Divi assets.

Get Divi Cloud
Divi Cloud
Divi Hosting

Want To Speed Up Your Divi Website? Find Out How 👇

Get fast WordPress hosting optimized for Divi.

Speed Up Divi
Divi Hosting
Premade Layouts

Check Out These Related Posts

Get a Free Coffee House Layout Pack For Divi

Get a Free Coffee House Layout Pack For Divi

Posted on April 22, 2024 in Divi Resources

Hey Divi Nation! Thanks for joining us for the next installment of our weekly Divi Design Initiative; where each week, we give away a brand new Layout Pack for Divi. This time around, the design team has created a beautiful Coffee House Layout Pack that’ll help you get your next Coffee House...

View Full Post
Get a Free Butcher Shop Layout Pack for Divi

Get a Free Butcher Shop Layout Pack for Divi

Posted on April 15, 2024 in Divi Resources

Hey Divi Nation! Thanks for joining us for the next installment of our weekly Divi Design Initiative; where each week, we give away a brand new Layout Pack for Divi. This time around, the design team has created a beautiful Butcher Shop Layout Pack that’ll help you get your next Butcher Shop...

View Full Post

1 Comment

  1. This is a great idea !

Leave A Reply

Comments are reviewed and must adhere to our comments policy.

Join To Download Today