Today I wanted to add my Author Box to the top of my “About” page. My page is using the full width layout. The content in my user profile is different than what I have on my About page. Plus, there isn’t a need to add an additional profile image if you are currently using your Gravatar image or a plugin to display your user profile image. Here is what I did to accomplish this:
Note: If you are the only user on your website, you do not need to modify the ID in this code. You can move on to Step 1. However, if there are more than one users on the blog, you will need to locate the ID of the user whose author box should appear on the “About” page. To locate that ID follow these instructions.
Go to Users then click the user whose Author Box you would like to show up. Then look in the address bar and locate the User ID. Keep that number handy and move on to Instructions.
On Line 7, I’ve chosen to use the page slug (https://cre8tivediva.com/about). You can read more about how to use the user’s page ID or page title in the codex.
Using an FTP program connected to your hosting account, browse to your theme folder and locate your functions.php file. Click “View Raw” in the bottom right corner of the code box below.
|add_action( 'genesis_before_entry', 'genesis_do_author_box_on_page' );|
|* Add author box to your individual About Page.|
|if ( ! is_page( 'about' ) )|
|if ( get_the_author_meta( 'genesis_author_box_single', get_the_author_meta( 'ID' ) ) )|
|genesis_author_box( 'single' );|
Copy and paste this code into the bottom of your functions.php file.
If you are not the only user on your site and you have the user id number to the appropriate user that should display on the About page, then you will need to replace the capital letters – ID – with the number you saved. For the purposes of this, I would replace ID with the number 10 (as shown in the image above).
Then hit Save.
Add styling in your style sheet if you need it.
If you have any caching plugins installed, you may need to clear your cache before you can see the end result.