Shortcode Usage
Display authors anywhere on your site using powerful shortcodes. No PHP knowledge required!
Available Shortcodes
ThemeRuby Multi Authors provides 5 shortcodes for different display needs:
| Shortcode | Purpose | Output |
|---|---|---|
[ema_authors] | Simple author list | Names with links |
[ema_author_box] | Complete author box | Avatars, bios, links |
[ema_author_list] | Unordered list | Structured list with optional avatars |
[ema_author_avatars] | Avatar display only | Just the profile pictures |
[ema_author_count] | Author count | Number of authors |
[ema_authors]
Display a simple formatted list of author names.
Basic Usage
[ema_authors]
Output:
John Doe, Jane Smith, Bob Johnson
With Custom Separator
[ema_authors separator=" & "]
Output:
John Doe & Jane Smith & Bob Johnson
With Before/After Text
[ema_authors before="Written by: " after=" - Thank you!"]
Output:
Written by: John Doe, Jane Smith - Thank you!
Without Links
[ema_authors link="false"]
Output:
John Doe, Jane Smith, Bob Johnson
(Plain text, no links)
For Specific Post
[ema_authors post_id="123"]
All Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
post_id | int | Current post | Post ID to get authors from |
separator | string | , | Text between author names |
link | bool | true | Link authors to their archives |
before | string | `` | HTML before the author list |
after | string | `` | HTML after the author list |
Complete Examples
Inline with text:
This article was written by [ema_authors separator=" and "].
Custom styling:
[ema_authors before='<div class="post-byline">By ' after='</div>' separator=" & "]
[ema_author_box]
Display a complete author box with avatars, bios, and links.
Basic Usage
[ema_author_box]
Output:
┌─────────────────────────────────┐
│ About the Authors │
│ │
│ [Avatar] John Doe │
│ Web developer and writer │
│ View all posts → │
│ │
│ [Avatar] Jane Smith │
│ Content editor and strategist │
│ View all posts → │
└─────────────────────────────────┘
Without Avatars
[ema_author_box show_avatar="false"]
Without Bios
[ema_author_box show_bio="false"]
Custom Avatar Size
[ema_author_box avatar_size="100"]
For Specific Post
[ema_author_box post_id="123"]
All Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
post_id | int | Current post | Post ID to get authors from |
show_avatar | bool | true | Display author avatars |
show_bio | bool | true | Display author bios |
avatar_size | int | 80 | Avatar size in pixels |
Complete Examples
Minimal box:
[ema_author_box show_avatar="false" show_bio="false"]
Large avatars with bios:
[ema_author_box avatar_size="120"]
In sidebar widget:
[ema_author_box show_bio="false" avatar_size="48"]
[ema_author_list]
Display authors as a structured unordered list.
Basic Usage
[ema_author_list]
Output:
• John Doe
• Jane Smith
• Bob Johnson
With Avatars
[ema_author_list show_avatar="true"]
Output:
• [Avatar] John Doe
• [Avatar] Jane Smith
• [Avatar] Bob Johnson
With Post Count
[ema_author_list show_count="true"]
Output:
• John Doe (42 posts)
• Jane Smith (28 posts)
• Bob Johnson (15 posts)
With Both Avatars and Count
[ema_author_list show_avatar="true" show_count="true" avatar_size="32"]
All Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
post_id | int | Current post | Post ID to get authors from |
show_avatar | bool | false | Display author avatars |
show_count | bool | false | Show post count for each author |
avatar_size | int | 32 | Avatar size in pixels |
Complete Examples
Full featured list:
[ema_author_list show_avatar="true" show_count="true"]
Names only:
[ema_author_list]
[ema_author_avatars]
Display only author profile pictures.
Basic Usage
[ema_author_avatars]
Output:
[Avatar] [Avatar] [Avatar]
Larger Avatars
[ema_author_avatars size="80"]
Without Links
[ema_author_avatars link="false"]
For Specific Post
[ema_author_avatars post_id="123" size="60"]
All Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
post_id | int | Current post | Post ID to get authors from |
size | int | 48 | Avatar size in pixels |
link | bool | true | Link avatars to author archives |
Complete Examples
Large linked avatars:
[ema_author_avatars size="80"]
Small avatar row:
[ema_author_avatars size="32" link="false"]
Custom post avatars:
[ema_author_avatars post_id="456" size="100"]
[ema_author_count]
Display the number of authors for a post.
Basic Usage
[ema_author_count]
Output:
3 authors
Custom Text
[ema_author_count text="Written by %d people"]
Output:
Written by 3 people
For Specific Post
[ema_author_count post_id="123"]
All Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
post_id | int | Current post | Post ID to get authors from |
text | string | Auto | Custom text with %d placeholder for count |
Complete Examples
In sentence:
This article has [ema_author_count] contributing to it.
Custom message:
[ema_author_count text="Collaboration between %d writers"]
Specific post:
[ema_author_count post_id="789" text="%d co-authors"]
Combining Shortcodes
You can use multiple shortcodes together:
<div class="post-meta">
<strong>Authors:</strong> [ema_authors separator=" & "]
<br>
<strong>Contributors:</strong> [ema_author_count]
</div>
[ema_author_box]
In Page Builders
Elementor
- Add Text Editor widget
- Switch to Text mode
- Paste shortcode
- Preview
Gutenberg Block Editor
- Add Shortcode block
- Paste shortcode
- Preview in frontend
Classic Editor
- Switch to Text mode
- Paste shortcode where needed
- Switch back to Visual mode
Widgets
- Go to Appearance > Widgets
- Add Text or HTML widget
- Paste shortcode
- Save
Styling Shortcodes
With Custom CSS
Add to your theme's style.css:
/* Style author links */
.ema-author-link {
color: #e74c3c;
font-weight: bold;
}
.ema-author-link:hover {
text-decoration: underline;
}
/* Style author avatars */
.ema-author-avatars {
text-align: center;
margin: 20px 0;
}
.ema-author-avatar-item img {
border: 3px solid #3498db;
}
/* Style author list */
.ema-author-list {
background: #f8f9fa;
padding: 20px;
border-radius: 8px;
}
.ema-author-list-item {
font-size: 16px;
padding: 12px 0;
}
/* Style author count */
.ema-author-count {
background: #3498db;
color: white;
padding: 8px 16px;
border-radius: 20px;
}
/* Style author box from shortcode */
.ema-shortcode-box {
background: #fff;
border: 2px solid #e0e0e0;
padding: 30px;
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
Inline Styles
<div style="background: #f5f5f5; padding: 20px; border-radius: 8px;">
[ema_authors before="<strong>By:</strong> "]
</div>
Use Cases
Article Byline
<div class="article-byline">
By [ema_authors separator=" & "] | [ema_author_count text="%d contributors"]
</div>
Sidebar Widget
<div class="author-widget">
<h4>Written By</h4>
[ema_author_list show_avatar="true"]
</div>
Footer Credit
<div class="article-footer">
[ema_author_box show_bio="false" avatar_size="60"]
</div>
Team Page
<h2>Our Authors</h2>
[ema_author_avatars size="100"]
<h3>Meet the Team</h3>
[ema_author_box]
Quick Author Info
[ema_author_avatars size="32"] [ema_authors separator=", "]
Conditional Display
While shortcodes don't support conditions directly, you can use them in templates:
<?php if ( tmauthors_has_multiple_authors() ) : ?>
<div class="multiple-authors">
<h4>This is a collaborative post by:</h4>
<?php echo do_shortcode( '[ema_author_list show_avatar="true"]' ); ?>
</div>
<?php else : ?>
<div class="single-author">
By <?php echo do_shortcode( '[ema_authors]' ); ?>
</div>
<?php endif; ?>
Troubleshooting
Shortcode Not Working
Check:
- Plugin is activated
- Shortcode spelling is correct
- You're using the correct shortcode block/widget
- Try with default attributes first
Styling Issues
Solutions:
- Clear browser cache
- Check for CSS conflicts
- Use browser inspector to check applied styles
- Add
!importantto your custom CSS if needed
Not Showing on Page
Possible causes:
- Post has no authors assigned
- Invalid
post_idparameter - Shortcode in wrong location
Test:
[ema_author_count]
If this shows "0 authors" or nothing, check author assignments.
Advanced Usage
In Custom Templates
// In your theme's template file
echo do_shortcode( '[ema_author_box]' );
Dynamic Post ID
<?php
$current_id = get_the_ID();
echo do_shortcode( "[ema_authors post_id='{$current_id}']" );
?>
With Filters
add_filter( 'ema_authors_shortcode_output', 'customize_author_output', 10, 3 );
function customize_author_output( $output, $authors, $atts ) {
// Add wrapper
return '<div class="my-custom-authors">' . $output . '</div>';
}
Best Practices
- Use Appropriate Shortcode - Choose the right shortcode for your needs
- Test First - Try shortcodes with default settings before customizing
- Keep it Simple - Don't over-customize; use CSS for styling
- Cache Friendly - Shortcodes work great with caching plugins
- Mobile Responsive - Test on different screen sizes
Next Steps
- Display Options - Customize author display
- Template Tags - For developers
- FAQ - Common questions