Author Box Title Customization in Genesis

Unless you are Ernest Hemingway, some other famous author, or run a single author WordPress/Genesis Framework powered site, you just might want to display the author's name in the entry meta area for your posts and pages. Another way to display your site's authors is with an author box. An author box can appear on single posts or archive pages. The Genesis Framework supports an author box and has one built-in ready for you to display. You can learn more about the Genesis Author Box either from Brian Gardner or Studio Press.

A user recently wrote and asked:

I want the Author Box Title to link to the author’s archive page when on a single post, but not when the Author Box is used on the Archive Page.

This works great if you want the title of the author box to read "About the Author". However, this doesn't meet the user's needs. We modified the above code to include the features the requester wants. As a word of caution, we do not use this code on our site out of security concerns (see below). If you decide to use this code, you do so at your own risk.

Modified Author Box Title Customization Snippet to Include Links

PHP

1

2

3

4

5

6

7

8

9

10

11

12

//* Customize the author box title

add_filter('genesis_author_box_title','vmf_custom_author_box_title');

functionvmf_custom_author_box_title(){

if(is_single()){

$author=get_the_author();

$author_link=''.$author.'';

return'<strong>About '.$author_link.'</strong>';

}else{

$author=get_the_author();

return'<strong>About '.$author.'</strong>';

}

}

A BIG Security Concern

There’s one BIG security concern I’d like to address with this approach. WordPress uses the user_nicename field as the URL for author archive pages. The user_nicename holds the same value as the user_login. There’s no way to change this in the admin area. By using author archive pages, you are exposing user login ids to the world. There’s no easy way to fix this. However, here’s an article that explains how to change the user_nicename through PHPMyAdmin: http://premium.wpmudev.org/blog/change-admin-username/

Reader Interactions

The Genesis Framework empowers you to quickly and easily build incredible websites with WordPress. Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go.

We only use analytical cookies on our website that allow us to recognize and count the number of visitors and to see how visitors move around the site when they are using it, but they do not identify you individually. They help us to improve the way our website works, for example by ensuring that users are finding what they are looking for easily. Read more about the cookies we use by clicking the Cookie Policy button. By clicking OK you agree to cookies being used in accordance with our Cookie Policy. If you don’t agree you can disable cookies—see the Cookie Policy for more details.