Select Page
The E is for Enhanced. The E- WordPress Tagline Click-to-Call Code Snippet does a bit more than the original WordPress Tagline Click-to-Call Code Snippet. While the “Enhanced” version still allows you to replace the default WordPress Tagline (description) with a custom “Click-to-Call” message, it also adds the ability to display custom “Click-to-Call” messages based on the specific website being viewed. This does assume you have multiple sites running on a WPMU (WordPress Network) installation.

E- WordPress Tagline Click-to-Call – Use Case

Lets say one of your clients has a small business, with locations in several nearby towns. Each of your client’s locations need a dedicated website, displaying specific contact details (such as address, phone numbers & social media) and a varying list of services, based on the services provided at that location. The basic branding is the same so you know a WPMU (WordPress Network) installation is suitable for this client’s website needs.

Click-to-Call could be a valuable conversion tool for this client, as you understand they set appointments, answer pre-sales questions and even accept payment by phone. However, you also know your client’s customers (the End User) need to be able to contact the correct location, based on where its most convenient for them to get the needed service(s).

Enter the “E- WordPress Tagline Click-to-Call” Code Snippet.

The “E- WordPress Tagline Click-to-Call” Code Snippet allows you to define a specific message, for each of your client’s locations, customizing the language and the telephone number. Using HTML5’s href=”tel tag in combination with the telephone number ensures the number can easily be dialed, from a smartphone, with a simple finger touch (Click-to-Call).

Click-to-Call features are even handier for Apple users, with new Mac Computers, iPads and iPhones, using the latest OS and all connected with the same Apple ID. A customer, searching the internet for a specific service, finds your client’s website. They select the location they’d like to obtain the service from, and when the location’s website loads, the customer sees the phone number they need to call. Mac users (when paired with an iPhone) can simply use their trackpad to click on the number, activating the FaceTime voice call feature (OS X Yosemite). The iPad responds in much the same way, but the customer will be using a screen instead of a trackpad.

PHP Code Snippet – Genesis Framework

Copy/Paste the PHP code below, to the Genesis Framework, Child Theme functions.php file:

[php]
//* Bamajr included Enhanced WordPress Tagline Click-to-Call
remove_action( ‘genesis_site_description’, ‘genesis_seo_site_description’ );

add_action( ‘genesis_site_description’, ‘bamajr_seo_site_description’ );
function bamajr_seo_site_description() {

global $blog_id;

if( $blog_id == 1 ) {
echo "Your-Text-Goes-Here. <strong>In-1st-Location-call: <a title="Call us at (111) 111-1111 Additional-Text-Goes-Here" href="tel:+11111111111">(111) 111-1111</a></strong>";
} elseif( $blog_id == 2 ) {
echo "Your-Text-Goes-Here. <strong>In-2nd-Location-call: <a title="Call us at (222) 222-2222 Additional-Text-Goes-Here" href="tel:+12222222222">(222) 222-2222</a></strong>";
} elseif( $blog_id == 3 ) {
echo "Your-Text-Goes-Here. <strong>In-3rd-Location-call: <a title="Call us at (333) 333-3333 Additional-Text-Goes-Here" href="tel:+13333333333">(333) 333-3333</a></strong>";
} elseif( $blog_id == 4 ) {
echo "Your-Text-Goes-Here. <strong>In-4th-Location-call: <a title="Call us at (444) 444-4444 Additional-Text-Goes-Here" href="tel:+14444444444">(444) 444-4444</a></strong>";
} else {
echo "Your-Text-Goes-Here. <strong>Available Toll-Free: <a title="Call us at (800) 800-8000 Additional-Text-Goes-Here" href="tel:+18008008000">(800) 800-8000</a></strong>";
}

}
[/php]

E- WordPress Tagline Click-to-Call – More Info

  1. NOTABLE ITEMS:
    • The bamajr in bamajr_seo_site_description does NOT have to remain. Simply replace “bamajr” with an identifier of your choice. HINT: there are two places this would need changed.
    • $blog_id represents the id given to each site, located in WPMU Network Admin > Sites.
    • elseif statements can be duplicated until you have fully represented all the websites, located in WPMU Network Admin > Sites.
    • the final else statement currently represents an option for a toll-free number for customers looking a business location, in a town where a business location does not exist.
    • Imagine the possibilities if you were able to modify this Code Snippet, for use with a GEO-Service Database.
  2. DISCLAIMER: Code Snippets are not posted until they have been tested and verified to work. In most cases, the Code Snippets are in use on this website or a client’s websites. However, all Code Snippets come without any warranty of functionality.

UPDATE: While initial tests of this code snippet, didn’t quickly result in major issues, some have now been discovered. The original code snippet does have a negative impact in how WordPress uses the Tagline/Description in other places. While I have left the original post and its included code snippet intact, I must now STRONGLY advise against its use.

There is a better way. Rather than use HTML within the WordPress “Tagline” field, I suggest this alternate WordPress Tagline Click-to-Call code snippet, for users of Genesis Framework Child Themes and have included it below.

PHP Code Snippet – Genesis Framework

Copy/Paste the PHP code below, to the Genesis Framework, Child Theme functions.php file:

[php]
//* Bamajr included WordPress Tagline Click-to-Call
remove_action( ‘genesis_site_description’, ‘genesis_seo_site_description’ );

add_action( ‘genesis_site_description’, ‘bamajr_seo_site_description’ );
function bamajr_seo_site_description() {

echo ‘Your Text Goes Here. <strong>Call now: <a title="Click-to-Call (###) ###-####" href="tel:+1##########">(###) ###-####</a></strong>’;

}
[/php]

Also, the alternate code I included in this comment, does NOT work outside of the Genesis Theming Framework, though the original other WordPress Themes code snippet, from my initial post, has been found to have the same problems.