WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Feb 28 2011

Add the Genesis Author Box to Pages

The Genesis tutorials tells how to set up Author Boxes, how to style Author Boxes, and how to add Author Boxes to Author Archive Pages.

As it currently stands, the author box can only be added to the author archive pages and the single post pages. And from what I see, it doesn't appear on pages like http://domain.com/page-name but does appear on http://domain.com/category/post-name. However, what if I wanted to have the author box appear on all the pages or just some or not on some. Well, here's how to do it.

To insert the author box on ALL pages:
[php]/** Add Genesis Author Box on Single Pages**/
add_action('genesis_after_post', 'genesis_do_author_box_page');
function genesis_do_author_box_page() {
if ( !is_page() )
return;

if ( get_the_author_meta( 'genesis_author_box_single', get_the_author_meta('ID') ) ) {
genesis_author_box( 'single' );
}

}[/php]

To insert the author box on ALL pages except...
[php]/** Add Genesis Author Box on Single Pages**/
add_action('genesis_after_post', 'genesis_do_author_box_page');
function genesis_do_author_box_page() {
$page_exclusions = array(42,'about-me','Contact'); //edit these pages, can take slugs, page names, or page/post ID
if ( ( !is_page() ) || is_page($page_exclusions) )
return;

if ( get_the_author_meta( 'genesis_author_box_single', get_the_author_meta('ID') ) ) {
genesis_author_box( 'single' );
}

}[/php]

To insert the author box on only certain pages:
[php]/** Add Genesis Author Box on Single Pages**/
add_action('genesis_after_post', 'genesis_do_author_box_page');
function genesis_do_author_box_page() {
$page_inclusions = array(42,'about-me','Contact'); //edit these pages, can take slugs, page names, or page/post ID
if ( is_page($page_inclusions) ) {
if ( get_the_author_meta( 'genesis_author_box_single', get_the_author_meta('ID') ) ) {
genesis_author_box( 'single' );
}
}
else
return;

}[/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

StudioPress Premium WordPress Themes     WP Engine Managed WordPress Hosting

What can I do for you!?

Custom Development

We develop plugins by determining both business/functional and technical requirements, following WordPress development best practices, and using agile methodology to ensure you get the best solution.

Consulting

Have questions? Need a reliable developer to consult? Please contact us today!

Customized Theme

We can customize your theme or child theme, or create a child theme for you based on your needs while enhancing the performance of every individual attribute.

Customized Plugin

We can customize your plugins, extend plugins (e.g., Gravity Forms, Jetpack, Soliloquy) based on your needs ensuring security, performance, and positive business impact.

Contact Us

About Travis Smith

As a WordPress enthusiast, developer, and speaker, Travis writes about what he learns in WordPress trying to help other WordPress travelers, beginners and enthusiasts with tutorials, explanations, & demonstrations.

Comments

  1. Vince says

    March 11, 2011 at 8:26 am

    There is really an easy way to do this, that is to go to your profile settings and enable it in every post.

    Just a question though, what child them are you using?

    Reply
  2. Vince says

    March 11, 2011 at 8:32 pm

    Ok, here’s the simple instruction:

    1. Login to your Dashboard.
    2. Go to “Users” Click “Your Profile”
    3. Set the name you want to publicly appear.
    4. Put something about yourself in “Biographical Info”. You can place some links if you want to.
    5. Scroll down below and you will see “Genesis User Settings”. Below it, you will see Genesis Admin Menus and Author Box. Tick accordingly, especially the one with: Enable Author Box on this User’s Posts?

    Things to note:
    1. If you don’t see the Genesis options, you might have a plugin installed that hinders them to appear. Sometimes it is a plugin that is also about showing author boxes.
    2. Another probable cause you might be using an older version of the theme that’s why there are lots of code conflicts and both the child theme and the Genesis framework cannot connect with each other. In that case, you will need to install the latest version of the new framework and the new child theme. Or you will have to install it manually.
    3. To have a gravatar enabled, I think you need to open an account on Gravatar.com which is also free. All you have to do is open an account and upload your picture.

    Reply
    • Travis Smith says

      March 11, 2011 at 11:40 pm

      Thanks Vince! However, this post gives instuctions and code that goes beyond those tick marks to allow the Author Box to be shown on pages, not just posts or Archives.

      Reply
  3. Vince says

    March 12, 2011 at 5:57 pm

    Yep… and that’s the beauty of Genesis customization. It’s a little bit technical, but very rewarding after you get what you really want. 🙂

    But as for me, the default author box feature is already enough to me, simply because, normally I only put author info on the posts, and not on the pages because most of my website pages already talk about me and my business.

    Reply
  4. Vince says

    March 12, 2011 at 6:05 pm

    By the way Travis, I noticed in your About Me page, you are a Theologian and a PHP?Java Script Coder Geek. 🙂 It’s really nice to know people like you having the same interest. It’s really nice to be here in your site. I am also a church minister, and had, Master of Divinity (“at least that’s what the piece of paper say”. Lol!). I am not a coder though. But I am a web savvy who also owned several websites.

    Perhaps one of these days, we can collaborate in some online jobs, ventures, or something. If God permits. 🙂

    Blessings!!!

    Reply
  5. Jack Falconberg says

    April 15, 2011 at 2:06 pm

    Travis, thanks for the informative post. Where would this code be inserted? functions.php? In the page content itself? Forgive me if this seems elementary (I’m not proficient). Thanks.

    Reply
    • wpsmith says

      April 15, 2011 at 2:22 pm

      Hello Jack,

      This would go into functions.php. Depending on which code you use the $page_exclusions or $page_inclusions will determine which pages the authorbox appears.

      Thanks,

      Reply
  6. Stefan says

    May 20, 2011 at 6:28 am

    Hey,

    Is it possible to set the author box to be active by default for all newly registered users?

    Thanks for any help.

    Reply
  7. Jennifer Johnson says

    February 6, 2013 at 6:49 am

    Thank you! I have been trying for hours! Your code worked perfectly! Thank you so much! I have hundreds of posts…but also quite a few pages and it bothered me that they were not showing my authorship.

    Reply
  8. Kingsley says

    May 20, 2013 at 2:23 pm

    Mine is not showing.. please can i have the previous code you used in this post?? this code is different from the code i used before

    Reply
  9. Sam says

    September 11, 2013 at 5:36 am

    ** Add Genesis Author Box on Single Pages**/ doesnt work with Genesis 2.0.
    Are there new hooks to make this function work?

    Reply

Leave a Reply Cancel 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.

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in