' . __( 'Sticky', 'aguafuerte' ) . ''; } // Set up and print post meta information. print(__('By ', 'aguafuerte')); 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( 'aguafuerte_related_posts' ) ) : /** * Retrieves the related posts to an individual posts by tag. * * @since Aguafuerte 1.0.1 */ function aguafuerte_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 %s ', 'aguafuerte' ), '' . get_the_title( get_the_ID() ) . '' ) ); return ' … ' . $link; } } add_filter( 'excerpt_more', 'aguafuerte_excerpt_more' ); endif; /** * Filter the except length to 20 characters. * * @param int $length Excerpt length. * @return int (Maybe) modified excerpt length. */ function aguafuerte_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'aguafuerte_excerpt_length', 999 );