As I am slowly developing a new plugin, Genesis Simple Authorbox, I realized that I should just release parts to the community that I believe would be beneficial. Follow these simple steps to incorporate the Authorbox Shortcode.
- Download the Genesis Simple Authorbox Shortcode: [download id="6"]
- Upload it to your Child Theme folder
- Add the following PHP Code to your functions.php file:
[php]require_once( CHILD_DIR.'/genesis-author-box-shortcode.php' );[/php]
Now you can use [genauthorbox] to produce the Genesis Authorbox anywhere you'd like. This is also perfect for Genesis Child Theme developers using do_shortcode().
Attributes
[genauthorbox] takes a few attributes. They are:
- before: Text/markup to place before the authorbox; default: <div class="author-box">
- after: Text/markup to place after the authorbox; default: </div>
- context: Context of the authorbox; default: '' NOTE: don't use this unless you are comfortable with it
- title: Title of the authorbox; default: "About First Last Name" (e.g., get_the_author())
- description: The author description/Biographical Info from Your Profile; default: (empty)
- gclass: Adds a class to the gravatar img; default: alignleft
- galt: Adds ability to provide an Alt Tag to the gravatar img; default: (empty)
- gsize: Adds ability to resize gravatar image; default: 70
- gemail: Fetch gravatar image by email (only changes the avatar & does not change the author information [e.g., title, description]); default: get_the_author_meta('email')
- userid: Overrides gemail, title, & description with the default user's (title: About First Last; description: biographical info; gemail: user's email); default: (empty)
Example
[genauthorbox title="About Mr. Starbucks" Description="I am a hopeless Starbucks addict, freelance web designer..." gsize=72 galt="not me" gemail="[email protected]"]
Vi Wickam says
I tried loading your code, and got the following error:
Parse error: syntax error, unexpected ‘]’ in /home/username/wp-content/themes/themename/genesis-author-box-shortcode.php on line 28
Thanks,
Vi
Stefanie says
Your download link above is no longer working. I was looking forward to seeing your code for making an authorbox shortcode. I haven’t found any other resources for being able to do this.