Skip to content

Instantly share code, notes, and snippets.

@remkus
Created January 3, 2014 10:54
Show Gist options
  • Save remkus/8236147 to your computer and use it in GitHub Desktop.
Save remkus/8236147 to your computer and use it in GitHub Desktop.
Best Author Fallback
<?php
/**
* Display best author posts as last widget in the sidebar
* @uses bap_get_user_posts
* @uses bap_get_single_post_user_id
* @return all the output
*/
function lh_best_author_posts() {
$bap_posts = bap_get_user_posts( bap_get_single_post_user_id() );
echo '<section class="best-author-posts widget">';
echo '<div class="best-author-posts-wrapper">';
echo '<p>De beste artikelen van</p>';
echo '<h5>';
the_author();
echo '</h5>';
echo '<p>Slimmer werken is een reeks inzichten en methodes die helpen om echt het verschil te maken en dat op een ontspannen, effectieve manier te doen. Lees hier de beste artikelen van ' . get_the_author_meta( 'first_name' ) . '.</p>';
echo '<p>De andere auteurs zijn <a href="http://lifehacking.nl/auteurs/">hier</a> te vinden.</p>';
echo '<ol class="best-posts">';
bap_print_post_titles( $bap_posts, array(
'before_single_title' => '<li>',
'after_single_title' => '</li>',
'show_featured_image' => false )
);
echo '</ol>';
echo '</div>';
lh_sidebar_author_image();
echo '</section>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment