This code enables you to create a custom field for a custom user Bio.
You can display the custom author description anywhere in your themes using one of 2 methods.
Firstly, here’s the field added to the wp-admin/profile.php page:
There’s 2 steps involved:
- Create the custom text area and save the data added to the custom field
- Display ( output ) the custom field data
# Step 1 – First step is to copy the PHP code from the functions.php file to the end of your child themes functions.php file.
The code adds a new text area to the end of your user profile page and saves the data you add to the field.
All you need to do now is display the data on the front end which you can do various ways.
# Step 2 – The PHP code in template-1.php can be used directly in any template file or your child themes functions file with a conditional tag.
If you’re using the author page template, you can use the code in template-2.php
Otherwise you can hook it in anywhere you like using
the_author_meta( 'extended_description' );
Leave a Reply
You must be logged in to post a comment.