Plugin Contributor
Ben
(@bforchhammer)
The plugin applies a bunch of (undocumented) filters on the different templates used for generating the output, which you might be able to use. All hooks are in Userlist.class.php (search for the use of the “apply_filters” function).
For your case you probably want to use the “aa_userlist_template” filter. You can use it by adding for example the following to your theme’s functions.php:
<?php
function aa_userlist_add_link_to_all( $template ) {
$url_link = '/all-bloggers';
$url_text = 'View all bloggers';
$template .= '<span class="all_bloggers_link"><a href="' . $url . '">' . $text . '</a></span>';
return $template;
}
add_filter('aa_userlist_template', 'aa_userlist_add_link_to_all');
?>
I haven’t tested it but this is how it should work in principle; you obviously need to adjust $url_link
and $url_text
, and add respective styling for span.all_bloggers_link
to your theme…
The default value for $template
is '<div class="author-list">{users}</div>'
and above function simply adds a link to the end of it.
Hope this helps.
Ben
AMAZING!! works so good.
any way i can place it in the author-list div as im using a dropdown widget plugin which hides and reveals widgets on a loop and right now my v’iew all’ link is outside the hide show area
Thanks so much for the help
Plugin Contributor
Ben
(@bforchhammer)
Try this version (which overrides the plugin’s default template):
<?php
function aa_userlist_add_link_to_all( $template ) {
$url_link = '/all-bloggers';
$url_text = 'View all bloggers';
$template = '<div class="author-list">{users} <span class="all_bloggers_link"><a href="' . $url . '">' . $text . '</a></span></div>';
return $template;
}
add_filter('aa_userlist_template', 'aa_userlist_add_link_to_all');
?>
Thanks starting to get the hang of it just trying to figure out how to only have this ‘view all’ link work in the widget and not on my page displaying all my bloggers
Plugin Contributor
Ben
(@bforchhammer)
Good point, I didn’t think of that… I don’t think there’s an easy way to change the template only for one instance and not the other, but you could use css styling to hide or show it respectively.
Add something like the following to your theme’s css:
.main_content .author-list .all_bloggers_link {
display: none;
}
You need to change .main_content
to a class that actually exists in your theme (and which is attached to the main content area).