Created
October 12, 2012 14:32
-
-
Save eftalyurtseven/3879486 to your computer and use it in GitHub Desktop.
Wordpress Yazara ait Benzer Yazıları Listelemek
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function yazarin_benzer_yazilari() { | |
global $authordata, $post; | |
$authors_posts = get_posts( array( 'author' => $authordata->ID, 'post__not_in' => array( $post->ID ), 'posts_per_page' => 5 ) ); | |
$output = '<ul>'; | |
foreach ( $authors_posts as $authors_post ) { | |
$output .= '<li><a href="' . get_permalink( $authors_post->ID ) . '">' . apply_filters( 'the_title', $authors_post->post_title, $authors_post->ID ) . '</a></li>'; | |
} | |
$output .= '</ul>'; | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment