' . __( 'Sticky', 'abedul' ) . ''; } // Set up and print post meta information. // Translators: there is a space after "By". print(__('By ', 'abedul')); printf( '', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), get_the_author() ); printf( '', esc_url( get_permalink() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); } endif; if ( ! function_exists( 'abedul_related_posts' ) ) : /** * Retrieves the related posts to an individual post by tag. * * @since Abedul 1.0 */ function abedul_related_posts($post) { $orig_post = $post; global $post; $tags = wp_get_post_tags($post->ID); //echo '
';print_r($tags);echo '
'; echo '
'; if ($tags): $tag_ids = array(); foreach ($tags as $tag): $tag_ids[] = $tag->term_id; endforeach; $args = array( 'tag__in' => $tag_ids, 'post__not_in' => array($post->ID), 'posts_per_page' => 4, // Number of related posts to display. 'ignore_sticky_posts' => 1, 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( 'post-format-quote', 'post-format-aside', 'post-format-status', 'post-format-chat', 'post-format-link', ), 'operator' => 'NOT IN', ),),); $query = new wp_query( $args ); if($query->have_posts()):?> %2$s', esc_url( get_permalink( get_the_ID() ) ), /* Translators: %s: Name of current post */ sprintf( __( 'More', 'abedul' ).' %s ', '' . get_the_title( get_the_ID() ) . '' ) ); return ' … ' . $link; } else{ return '. '; } } add_filter( 'excerpt_more', 'abedul_excerpt_more' ); endif; /** * Filter the except length to 20 characters. * * @param int $length Excerpt length. * @return int (Maybe) modified excerpt length. */ function abedul_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'abedul_excerpt_length', 999 );