Take Control of the Beaver Builder Theme Footer with Shortcodes

Take Control of the Beaver Builder Theme Footer with Shortcodes

The Beaver Builder theme comes with the ability to overwrite the “Powered by Beaver Builder” text in the footer section.

Take Control of the Beaver Builder Theme Footer with Shortcodes

It’s common practice for web developers and designers working on client websites, to make this one of the first things you do. Change the default theme junk, right? Nobody wants to deliver a website to a client with Powered by Beaver Builder, WordPress, etc to a client.

But, the method Beaver Builder suggests is complicated for many people new to WordPress or development in general. As they explain in this knowledge base article,  you need to copy the copyright.php file from the main theme into your child theme directory to change or remove the “Powered By…” text.

I used to do it that way. Templating is a great way to overwrite theme functions like this, WooCommerce templates, and more. But, unless you’re writing a theme from scratch, there’s a better method.

There’s a Better Way.

The method below is better. What if the copyright.php file is updated in the BB theme? Your changes would overwrite those new updates.

There are advantages to using the WordPress customizer to manage footer content like this, as they also explain in the KB article. It’s ideal to minimize the number of places and methods you need to change code so you can remember how to do changes quickly. If you’re using the customizer for the footer at all, why not just leave it all in the customizer?

How Astra Does It.

Astra theme, which has taken the Beaver Builder community by storm gives developers the ability to change this easily by building in shortcodes so you can add current_year and site_title, etc. to replace the “Powered by…” in the footer area using the customizer.

There’s no need to change the theme for something like this. Instead of overwriting the copyright.php file, you can add the shortcodes yourself. Then, simply add them to the text editor in customizer.

How to Create the Shortcodes

Step 1

Create a Must Use Plugin. This is the best way to create functions that are theme independent and will be used even if you switch themes.

Create a directory called “mu-plugins” under the wp-content folder like so: /wp-content/mu-plugins/

(You can also add this to your functions.php file if you don’t want to muck with must use plugins.)

In the mu-plugins directory, create a file called, “bb-shortcodes.php” and add the following code:

<?php

/**
 * Plugin Name: Shortcodes
 * Description: Current year shortcode, Site Title, more
 * Author:      Evan Emerson
 * License:     GNU General Public License v3 or later
 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
 */

function ere_current_year_shortcode() {
	$current_year = date('Y');
	return $current_year;
}
add_shortcode('current_year', 'ere_current_year_shortcode');

function ere_site_title_shortcode() {
	$site_title = get_bloginfo( $show, 'display' );
	return $site_title;
}
add_shortcode('site_title', 'ere_site_title_shortcode');

function ere_theme_author_shortcode() {
	$theme_author = wp_get_theme();
	//$theme_author->get( 'Author' );
	
	$theme_author_uri = wp_get_theme();
	//$theme_author_uri->get( 'AuthorURI' );
	
	$theme_author_link = '<a href="'.$theme_author_uri->get( 'AuthorURI' ).'" rel="nofollow">'.$theme_author->get( 'Author' ).'</a>';
	return $theme_author_link;
}
add_shortcode('theme_author', 'ere_theme_author_shortcode');

You don’t need to activate this. See more on MU Plugins. It automatically runs.

Step 2

Add these shortcodes to Customizer -> Footer -> Footer Layout -> Column 1 Text

Copyright © [current_year] [site_title] | Powered by [theme_author]

It’ll look like this.

Shortcodes in Customizer for the Beaver Builder Theme Footer

Shortcodes in Customizer for the Beaver Builder Theme Footer

Step 3

Hit Publish and visit your site. It’ll look similar to this.

output of shortcodes in beaver builder theme footer

Output of shortcodes in footer

That’s it.

This replicates what many themes show out-of-the-box and gives you complete control over the footer.

Now, if you’re building a website for your business or for a client, remove the | Powered by Evan Emerson from the customizer. I’ll remove it from this site once this post is finished. It’s there just in case someone wants to include it, as the Astra theme offers.

Edit Footer Details the “WordPress Way”

Just to be thorough, make sure you know how to edit the footer details the WordPress way.

Year

The year will automatically update. It comes from PHP and the server time. If this is off, contact your host or get a new host.

Site Title

The site title can be changed in wp-admin.

Go to Settings -> General and edit the Site Title field.

Changing this will change what’s output in many locations of your site and meta, including the footer.

Theme Author

The name of the Theme Author and the Author URI the name link to comes from the style.css file of your Beaver Builder child theme.

Edit style.css in wp-admin.

Go to Appearance -> Editor and select Stylesheet (style.css)

Author: the name you see after “Powered by”

Author URI: the link the Author links to

Edit these lines and you’re all set.

You can also edit the style.css file using FTP, SSH, etc. But, for people who like to work in one place, this should get it done.

Did this work for you?

Let me know how this works for you. Did you use this or do you have another method of changing the footer credentials area?

← Remove Versioning in WordPress CSS and JS ScriptsCreate Template in Beaver Themer to Select in WordPress Page Template Field →