
%3$s
%4$s
',
esc_url( home_url( '/' ) ),
esc_attr(wp_get_attachment_image_url(get_theme_mod('custom_logo'), 'full') ),
esc_html( get_bloginfo( 'name') ) ,
esc_html( get_bloginfo( 'description') ) );
return $html;
}
add_filter('get_custom_logo', 'abedul_custom_logo');
if ( ! function_exists( 'abedul_blog_navigation' ) ) :
/**
* Applies the user's choice for navigation/pagination and changes the default strings in the_posts_navigation() and the_posts_pagination().
*
* @since Abedul 1.0.1
*/
function abedul_blog_navigation() {
$abedul_theme_options = abedul_get_options( 'abedul_theme_options' );
if ( $abedul_theme_options['blog_navigation'] == 'navigation' ) :
the_posts_navigation( array(
'prev_text' => __( 'Older articles', 'abedul' ),
'next_text' => __( 'Newer articles', 'abedul' ),
) );
else:
the_posts_pagination( array(
'prev_text' => '' . __( 'Previous page', 'abedul' ) . '',
'next_text' => '' . __( 'Next page', 'abedul' ) . '',
'before_page_number' => '' . __( 'Page', 'abedul' ) . ' ',
) );
endif;
}
endif;
if ( ! function_exists( 'abedul_related_posts_by_tag' ) ) :
/**
* Retrieves the related posts to an individual post by tag.
*
* @since Abedul 1.0.1
*/
function abedul_related_posts_by_tag($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',
'post-format-audio',
),
'operator' => 'NOT IN',
),),);
$query = new WP_Query( $args );
if($query->have_posts()):?>
ID);
//echo '';print_r($categories);echo '
'; echo '
';
if ($categories):
$cat_ids = array();
foreach ($categories as $category):
$cat_ids[] = $category->term_id;
endforeach;
$args = array(
'category__in' => $cat_ids,
'post__not_in' => array($post->ID),
'posts_per_page' => 2, // 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',
'post-format-audio',
),
'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 );