__( 'Navbar', 'amez' ),
)
);
}
add_action( 'init', 'reg_menu' );
/**
* add theme support for post thumbnails ( featured images )
*/
if (function_exists('add_theme_support')) {
add_theme_support('post-thumbnails');
add_image_size('amez', 260, 260, true);
add_image_size('archive', 120, 120, true);
}
/**
* Callback for Comments lists in comments.php
*/
function amez_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
>
%s', get_comment_author_link()) ?>
$depth, 'max_depth' => $args['max_depth']))) ?>
';
the_tags('', '', '');
echo '';
}
}
}
/**
* page links | used in single.php
*/
if ( ! function_exists( 'amez_link_pages' ) ) {
function amez_link_pages() {
wp_link_pages(
array (
'before' => '' . __( 'Pages:', 'amez' ) . '',
'after' => '
',
'link_before' => '',
'link_after' => '',
)
);
}
}
/**
* excerot length in category loop
*/
function amez_excerpt( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'amez_excerpt' );
/**
* pagenavi links
*/
if ( ! function_exists( 'amez_pagenavi' ) ) {
function amez_pagenavi() {
global $wp_query, $wp_rewrite;
$pages = '';
$max = $wp_query->max_num_pages;
if (!$current = get_query_var('paged')) $current = 1;
$a['base'] = str_replace(999999999, '%#%', get_pagenum_link(999999999));
$a['total'] = $max;
$a['current'] = $current;
$total = 1; //1 - display the text "Page N of N", 0 - not display
$a['mid_size'] = 5; //how many links to show on the left and right of the current
$a['end_size'] = 1; //how many links to show in the beginning and end
$a['prev_text'] = __( 'newer' ,'amez'); //text of the "Previous page" link
$a['next_text'] = __( 'older' ,'amez'); //text of the "Next page" link
if ($max > 1) echo '';
if ($total == 1 && $max > 1) $pages = ''. __( 'page ' ,'amez') . $current . __( 'of ' ,'amez') . $max . ''."\r\n";
echo $pages . paginate_links($a);
if ($max > 1) echo '
';
}
}
/**
* archive title
*/
if ( ! function_exists( 'amez_archive_title' ) ) {
function amez_archive_title() {
if ( is_day() ) :
printf( __( 'Daily Archives: %s', 'amez' ), get_the_date() );
elseif ( is_month() ) :
printf( __( 'Monthly Archives: %s', 'amez' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'amez' ) ) );
elseif ( is_year() ) :
printf( __( 'Yearly Archives: %s', 'amez' ), get_the_date( _x( 'Y', 'yearly archives date format', 'amez' ) ) );
else :
_e( 'Archives', 'amez' );
endif;
}
}