'.esc_html__('Read more…','aazeen').'';
} elseif ( is_front_page() ) {
// static homepage
return '...';
} elseif ( is_home() ) {
// blog page
return ''.esc_html__('Read more…','aazeen').'';
} else {
//everything else
return ' '.esc_html__('Read more…','aazeen').'';
}
else :
return '...';
endif;
}
add_filter('excerpt_more', 'aazeen_excerpt_more');
/**
* Link thumbnails to their posts based on attr
*
* @param $html
* @param int $pid
* @param int $post_thumbnail_id
* @param int $size
* @param array $attr
*
* @return string
*/
function aazeen_filter_post_thumbnail_html( $html, $pid, $post_thumbnail_id, $size, $attr ) {
if ( ! empty( $attr[ 'link_thumbnail' ] ) ) {
$html = sprintf(
'%s',
esc_url(get_permalink( $pid )),
esc_attr( get_the_title( $pid ) ),
$html
);
}
return $html;
}
add_filter( 'post_thumbnail_html', 'aazeen_filter_post_thumbnail_html', 10, 5 );
/**
* comments meta
*/
if (! function_exists('aazeen_meta_comment')) :
function aazeen_meta_comment()
{
if (! post_password_required() && (comments_open() || get_comments_number())) {
echo '';
/* translators: %s: post title */
comments_popup_link(sprintf(wp_kses(__('Leave a Comment on %s', 'aazeen'), array( 'span' => array( 'class' => array() ) )), get_the_title()));
echo '';
}
}
endif;
/**
* Prints categories list.
*/
if (! function_exists('aazeen_category_list')) :
function aazeen_category_list()
{
$categories = get_the_category();
$output = '';
if (is_single()) {
$separator = '';
if (! empty($categories)) {
foreach ($categories as $category) {
$output .=
'' . esc_html($category->name) . '' . $separator;
}
}
} else {
$separator = '';
if (! empty($categories)) {
foreach ($categories as $category) {
$output .=
'' . esc_html($category->name) . '' . $separator;
}
}
}
echo trim($output, $separator);
}
endif;
// Print categories for widgets
if (! function_exists('aazeen_category_widgtesmission')) :
function aazeen_category_widgtesmission()
{
$categories = get_the_category();
$output = '';
$separator = '';
if (! empty($categories)) {
foreach ($categories as $category) {
$output .=
'' . esc_html($category->name) . '' . $separator;
}
}
echo trim($output, $separator);
}
endif;
if (! function_exists('aazeen_meta_tag')) :
/**
* Prints HTML with meta information for the tags .
*/
function aazeen_meta_tag()
{
// Hide category and tag text for pages.
if ('post' === get_post_type()) {
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list('');
if ($tags_list) {
echo '';
_e('Tagged:', 'aazeen');
echo '';
echo $tags_list;
}
}
}
endif;
if (! function_exists('aazeen_edit_link')) :
/**
* Prints HTML with meta information for the tags .
*/
function aazeen_edit_link()
{
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
esc_html__('Edit %s', 'aazeen'),
the_title('"', '"', false)
),
''
);
}
endif;
if (! function_exists('aazeen_time_link')) :
/**
* Gets a nicely formatted string for the published date.
*/
function aazeen_time_link()
{
$time_string = '';
$time_string = sprintf(
$time_string,
get_the_date(DATE_W3C),
get_the_date(),
get_the_modified_date(DATE_W3C),
get_the_modified_date()
);
$archive_year = get_the_time('Y');
$archive_month = get_the_time('m');
// Wrap the time string in a link, and preface it with 'Posted on'.
return sprintf(
/* translators: %s: post date */
__('Posted on %s', 'aazeen'),
'' . $time_string . ''
);
}
endif;
/* Function which displays your post date in time ago format */
function aazeen_time_ago() {
return human_time_diff( get_the_time( 'U' ), current_time( 'timestamp' ) ).' '.esc_html__( 'ago','aazeen' );
}
if (! function_exists('aazeen_author_bio')) :
function aazeen_author_bio()
{
// Post meta author
$author = sprintf(
esc_html_x('Posts by: %s', 'post author', 'aazeen'),
esc_html(get_the_author())
);
echo $author ;
}
endif;
/**
* Post page title “Category:”, “Tag:”, “Author:”, “Archives:” and “Other taxonomy name:”
*/
if (! function_exists('aazeen_getpost_page_title')) :
function aazeen_getpost_page_title()
{
if (is_category()) {
$title = single_cat_title('', false);
} elseif (is_tag()) {
$title = single_tag_title('', false);
} elseif (is_author()) {
$title = aazeen_author_bio();
} elseif (is_archive()) {
$title = the_archive_title();
} elseif (is_tax()) {
$title = single_term_title('', false);
} elseif (is_search()) {
$title = sprintf(esc_html__('Search Results for: %s', 'aazeen'), esc_html(get_search_query()));
}
return $title;
}
endif;
/**
* Post page main title “Category:”, “Tag:”, “Author:”, “Archives:” and “Other taxonomy name:”
*/
if (! function_exists('aazeen_mainpost_page_title')) :
function aazeen_mainpost_page_title()
{
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo aazeen_getpost_page_title();
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo aazeen_breadcrumb();
echo '
';
echo '
';
echo '
';
echo '
';
}
endif;
if (! function_exists('aazeen_mainpost_blog_title')) :
function aazeen_mainpost_blog_title()
{
echo '
';
echo '
';
echo '
';
echo '
';
echo esc_html__('Blog', 'aazeen');
echo '
';
echo '
';
echo '
';
echo '
';
}
endif;
/**
* Adds custom classes to the array of body classes.
*
* @param array $classes Classes for the body element.
* @return array
*/
function aazeen_body_classes( $classes ) {
$select_header_style = get_theme_mod('select_header_style','header1');
/* Adds a class whether layout is boxed or wide */
$classes[] = $select_header_style;
return $classes;
}
add_filter( 'body_class', 'aazeen_body_classes' );