WordPress plugin documentation

DiceBar: a mobile bottom bar for WordPress

A sticky bar across the bottom of the screen on phones, holding a click to call button, a chat button, directions, social icons or a link to anywhere on your site. Free, with no tracking, and it works with any theme.

What a mobile bottom bar does

Most visitors arrive on a phone. On a phone, a phone number in the footer is four scrolls away and a contact form is a wall. A bottom bar puts the action under the thumb on every page.

DiceBar adds that bar to any WordPress site. You choose what goes in it, where it appears, and what it looks like. Everything described on this page is in the free plugin.

Click to call

Taps straight into the phone's dialler, with no page load in between.

Chat

Opens a messaging app, with a message already written if you want one.

Directions

Opens the map app with your address already searched.

Social profiles

Thirty networks, optionally drawn in their own colours.

Installing the plugin

  1. In your dashboard, go to Plugins, then Add New.
  2. Search for DiceBar.
  3. Install it, then activate it.
  4. Open DiceBar in the dashboard menu.

It needs WordPress 6.0 or newer and PHP 7.4 or newer. It has no other dependencies and makes no external requests.

The bar does not appear until you add at least one button. That is deliberate: a bar drawing its frame around nothing is worse than no bar.

Adding buttons to the bar

On the Items tab, choose a starter kit or press Add an item. Each button has a type, a label, and one value such as a phone number or a web address.

Drag the handle at the left of a row to reorder buttons. The order in the list is the order on the bar.

Why four buttons is the limit

At 320 pixels wide, which is the narrowest phone still in real use, the bar has 288 pixels of usable width. Four labelled buttons is 72 pixels each, which fits a word of about eight characters. A fifth button does not shrink the words, it cuts them short. The plugin caps the list at four and says why, rather than letting you discover it on a visitor's screen.

Making one button stand out

Tick Make this the standout button on the button that matters most, usually Call or Book. It renders in your accent colour while the others stay neutral. Use it on one button only; two standout buttons is none.

Button types

TypeWhat you enterWhat it does
CallPhone numberOpens the dialler with the number ready
WhatsAppNumber with country codeOpens a chat, with an optional prewritten message
Text messagePhone numberOpens the messaging app, with an optional body
EmailEmail addressOpens the mail app, with an optional subject
LinkAny web addressA normal link, optionally in a new tab
PageChoose a pageLinks to it, and keeps working if you change its address
Scroll to a sectionA section id such as #contactScrolls smoothly down the current page
DirectionsAddress or map linkOpens the map app with your address searched
Social profileNetwork and profile addressLinks to your profile using that network's mark
ShareNothingOpens the phone's share sheet, or copies the address
Back to topNothingScrolls smoothly to the top
Anything elseLabel, address, iconFor whatever the list above does not cover

Only five link types are ever allowed: web, secure web, telephone, email and text message. Anything else is rejected when you save, including for administrators, because an administrator account can be compromised and a script link in a button is a serious problem.

Starter kits

The hardest part of a bar like this is deciding what belongs in it. Nine kits fill the list in one click, and everything stays editable afterwards.

KitButtonsSuits
Call and chat2Most small businesses
Call, message, directions3A shop or office people visit
Restaurant4Booking, questions, directions, menu
Clinic or salon4Booking as the standout button
Trade or service call-out3Someone with a leak, not a contact form
Online shop4Shop, search, cart, account
Social profiles4Icon-only, in each network's colours
Blog or magazine3Share, subscribe, back to top
Portfolio3One way to reach you, one to see the work

Design and looks

The Design tab has four ready-made looks. The preview beside the settings shows the real bar, drawn with the real stylesheet, so what you see is what visitors get.

LookWhat it isBest for
GlassFrosted, floating panel with an adjustable blurMost sites. It is how phones draw their own bars
SolidNo translucency at allBusy photography, or a theme that already blurs
MinimalNo panel; buttons sit on the pageQuiet, editorial designs
BoldFilled in a colour you chooseWhen the bar is the page's main call to action

Icons, words, or both

Each button can show an icon and a word, an icon only, or a word only. It applies to the whole bar rather than one button, because an unlabelled icon centres itself while a labelled one lifts to make room. Mixing them leaves one mark sitting lower than its neighbours for no reason anybody can see.

Colours and dark mode

Light and dark colour sets are chosen separately, eight values each. Dark mode is what you decided rather than an automatic inversion of your brand colour, which is almost always wrong. The preview has a Dark button so you can check it before saving.

Your own CSS

Every value is a custom property on the bar's wrapper, so you can override anything without fighting the plugin and without an !important.

.dicebar {
	--dicebar-radius: 24px;
	--dicebar-accent: #e11d48;
}

Where the bar shows

The Where tab controls three things independently.

  • Screens. Phones only, phones and tablets, or every screen. Both width boundaries are settable.
  • Pages. Everywhere, only on the pages you list, or everywhere except those pages. Enter post or page ids, separated by commas. The id is in the address bar when you edit a page.
  • Visitors. Everyone, signed in visitors only, or signed out visitors only.

Individual buttons can have their own screen and visitor rules too, so one button can appear where another does not.

Behaviour

  • Position. Bottom, which is where thumbs are, or top if your theme already occupies the bottom.
  • On scroll. Always visible, or hiding as the visitor scrolls down and returning as they scroll up.
  • Step aside for. Name a CSS selector and the bar gets out of the way while that element is on screen. A Call button is noise beside the contact section carrying the same number.
  • Keep clear. Space left below the bar, for when a cookie banner sits in the same place.
  • Stacking order. Lower it if the bar covers one of your theme's pop-ups, raise it if something covers the bar.

The bar also leaves room for the home indicator on modern phones, respects a visitor's reduced-motion preference, and never prints.

Shortcode and page builders

You do not have to place the bar. It appears by itself on every page you allow it on, in any theme, because it attaches to the footer hook that every theme has to call.

To also show the same row of buttons inside your content, use the shortcode. The inline copy drops the fixed positioning, the blur and the shadow, so it sits in the page rather than floating over it.

[dicebar]

To show only some of the buttons, name them by id. Ids are shown beside each button on the Items tab.

[dicebar items="itm_a1b2c3d4, itm_e5f6a7b8"]

The shortcode works in the block editor, in a widget, in a theme template through do_shortcode(), and in Divi, Beaver Builder, Bricks and Oxygen.

Using it with Elementor

The bar itself appears on Elementor pages like any other, with no setup at all.

To place the row inside a page, search for DiceBar in the Elementor panel. The widget takes one optional setting, a list of button ids, and everything else comes from the plugin's own settings so restyling the bar restyles every copy of it.

The widget only exists when Elementor is active. Nothing Elementor-related is loaded otherwise, so an install without it carries no cost.

Caching

This was designed for caching rather than patched for it afterwards. A full-page cache stores one copy of a page and serves it to everybody, which quietly breaks any rule that differs between two visitors looking at the same address.

The plugin splits its rules by which kind they are.

RuleWorked outWhy
Which pageOn the serverVaries with the address, so a cache keyed on the address is correct
Screen widthIn CSSThe browser re-evaluates it on rotation for free
Signed in or outIn the browserDiffers between two visitors on the same address

The script is also marked so that optimisers do not defer or combine it, since it decides what a visitor sees and deferring it would show the wrong thing first.

Tracking taps

The plugin collects nothing and sends nothing anywhere. That does not change.

It does announce a tap inside the page, so your own tag manager or analytics can listen for it. Nothing leaves the browser because of the plugin; what happens next is entirely your own code.

document.addEventListener( 'dicebar:click', function ( event ) {
	// event.detail.id   the button's id
	// event.detail.type the button's type, such as "call"
	window.dataLayer = window.dataLayer || [];
	window.dataLayer.push( {
		event: 'footer_bar_click',
		button: event.detail.type
	} );
} );

Every button also carries stable data attributes, so a tag manager can target one with a selector instead.

For developers

Filters

FilterWhat it changes
dicebar_item_typesRegister your own button type
dicebar_iconsAdd or replace icons
dicebar_presetsAdd your own starter kits
dicebar_will_renderDecide whether the bar renders on a request
dicebar_z_indexChange the stacking order in code

Adding a button type

add_filter( 'dicebar_item_types', function ( $types ) {
	$types['booking'] = array(
		'label' => 'Booking',
		'icon'  => 'calendar',
		'value' => array( 'kind' => 'url', 'label' => 'Booking address' ),
		'extra' => array(),
	);

	return $types;
} );

An entry missing any of those keys is discarded rather than causing a warning somewhere else, so a partial registration fails quietly at the registry instead of loudly at render time.

Troubleshooting

The bar does not appear

Check that it is turned on, that at least one button has a value filled in, and that you are looking at a screen narrower than the width on the Where tab. A button with an empty address is dropped rather than rendered dead.

Something covers the bar, or the bar covers something

Change the stacking order on the Behaviour tab. Raise it if something sits on top of the bar, lower it if the bar sits on top of a pop-up.

A cookie banner overlaps it

Use Keep clear on the Behaviour tab to leave space below the bar.

The last line of my page is hidden

It should not be. The plugin measures the bar and gives the page that space back. If your theme sets its own bottom padding with an !important, that will win; add a rule for body using the --dicebar-height property.

Questions

Does it work with my theme?

Yes. The bar attaches to the footer hook, which every theme WordPress accepts has to call. The realistic conflict is stacking order, and there is a setting for that.

Does it slow my site down?

It loads nothing at all on any page where it does not appear, not even a stylesheet. Where it does appear, it adds one small stylesheet and one small script, with no jQuery and no external requests.

Is it really free?

Yes. Every feature on this page is in the free plugin. There is no locked tier and no adverts in your dashboard.

Does it work with WooCommerce?

Yes. You can point buttons at the shop, cart or account pages, and the Online shop starter kit sets that up for you.

Can I use it in more than one language?

The plugin ships a translation template and every visible string goes through it. Button labels you type are your own text and are translated the way the rest of your content is.

Does it collect any data?

No. Nothing is collected, nothing is sent anywhere, and the plugin contacts no external service of any kind.

What happens to my settings if I delete the plugin?

They are removed, unless you tick the option to keep them. People often deactivate a plugin briefly to test a conflict, and losing a configuration to that is infuriating.