Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function t4b_get_related_author_posts() {
- global $authordata, $post;
- if(get_post_type() == 'quick-tips') {
- $post_type = 'quick-tips';
- } else { $post_type = 'post'; }
- $authors_posts = get_posts( array( 'author' => $authordata->ID, 'post_type' => $post_type, 'post__not_in' => array( $post->ID ), 'posts_per_page' => 1 ) );
- if($authors_posts) :
- $output = '<div id="t4b-latest-tune">';
- foreach ( $authors_posts as $authors_post ) {
- $post_date = $authors_post->post_date;
- $post_date = mysql2date('M j, Y g:i:s a', $post_date);
- $postDate = $authors_post->post_date;
- $hide_extra = get_date_time_count($postDate);
- if ( has_post_thumbnail() ) {
- $output .= get_the_post_thumbnail($authors_post->ID, 'sidebar-thumb');
- } else {
- $output .= '<img src="'.get_stylesheet_directory_uri().'/images/wp-logo.png" alt="TiPS4BLOG" />';
- }
- $output .= '<h4><a href="' . get_permalink( $authors_post->ID ) . '">';
- $output .= apply_filters( 'the_title', $authors_post->post_title, $authors_post->ID ) . '</a></h4>';
- $output .= '<p>' . $post_date . ' ( ' . $hide_extra . ' আগে )</p>';
- }
- $output .= '</div>';
- else :
- $output = '<div id="t4b-empty-tune">';
- $output .= '<h4>*** এই ব্লগে এটাই আমার প্রথম টিপস ***</h4>';
- $output .= '</div>';
- endif;
- return $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement