This website uses cookies to allow us to see how the site is used. If you continue to use this site, we assume that you are okay with this. If you want to use the sites without cookies, please see our privacy policy.

Shortcode for Copyright, Credit and Login Access Sitewide

Once a site is launched, one of the most fundamental tools a client needs is easy access to login and logout of the site. Telling them where the WP login page is located is not something they will typically remember. It’s become quite a lifesaver to put a small footer link on every page that allows them to login, logout, or get back to the dashboard. Also, its a great place to provide attribution back to the site designer, if that’s something you want to do. Couple that with an automatically updating copyright statement and we have a very useful footer snippet!

Use this handy shortcode to display a short line or two of text at the bottom of every page showing your site’s copyright (automatically updated to this year) and a simple login/logout link. It also optionally will provide credit for the site’s designer.

Here’s an Example

Logged out View of Shortcode
Logged In View of Shortcode

Using the Shortcode

  1. Copy the following into your functions.php file.
  2. Update the default settings to be your own site designer information.
  3. Then place the shortcode [credits] into the footer of your site.
// Copyright/Credit/Access Shortcode
// Usage: [credits oscredit="false" title="" link="" link_title="" linebreak="true"]
// All parameters optional. Defaults set below.

add_shortcode('credits', 'opensky_credits_function');
function opensky_credits_function( $atts, $content = null ) {
   extract( shortcode_atts( array(
      'oscredit' => 'true', //set true|false to show or hide designer's credit
      'title' => 'Open Sky Web Studio', // designer's name
      'link' => 'https://www.openskywebstudio.com', // link to designer's website
      'link_title' => 'Open Sky Web Studio | Clean, Effective Websites', // designer's link title for seo
      'linebreak' => 'true', // true|false to display on one line or two
      ), $atts ) );

 $creds = "<span id='credits'>Copyright © " . date('Y') . " <a href='".get_option('home')."' title='".get_bloginfo('name')." | ".get_bloginfo('description')."'>".get_bloginfo('name')."</a>. All Rights Reserved. ";
 
 if (strtolower($oscredit) == "false")
 $creds .= "<!--";

 if (strtolower($linebreak) == "true")
 $creds .= "<br/>";
 
 $creds .= "Site Design • <a href='".$link."' title='".$link_title."' target='_blank'>".$title."</a> • ";

 if (strtolower($oscredit) == "false")
 $creds .= "-->";
 $creds .= wp_loginout('', false) . wp_register(' • ', '', false) . '</span>';

 return $creds;
}

About

Karena is proud to run Open Sky Web Studio along with an amazing team of WP enthusiasts. With a unique combination of technical skills and a strong design eye, we have over a decade of experience in building our clients' compelling, professional web presence. Then we put feet to the vision. Skilled in business development, web marketing, and copywriting, we walk alongside our clients from concept to robust results.

2 thoughts on “Shortcode for Copyright, Credit and Login Access Sitewide

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.