for posts and comments.
add_theme_support( 'automatic-feed-links' );
global $content_width;
if ( ! isset( $content_width ) )
$content_width = 900; /* pixels */
add_theme_support( "title-tag" );
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 798, 398, true );
add_image_size( 'akyra-full-width', 1038, 576, true );
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(
'primary' => __( 'Main Menu', 'akyra' ),
'secondary' => __( 'Secondary menu for footer menu', 'akyra' ),
) );
// This theme allows users to set a custom background.
add_theme_support( 'custom-background', apply_filters( 'akyra_custom_background_args', array(
'default-color' => 'f5f5f5',
) ) );
// Add support for featured content.
add_theme_support( 'featured-content', array(
'featured_content_filter' => 'akyra_get_featured_posts',
'max_posts' => 6,
) );
// This theme uses its own gallery styles.
add_filter( 'use_default_gallery_style', '__return_false' );
}
endif; // akyra_setup
add_action( 'after_setup_theme', 'akyra_setup' );
function akyra_of_head_css() {
$output = '';
$custom_css = esc_attr(get_theme_mod( 'akyra_custom_css' ) );
if ($custom_css <> '') {
$output .= $custom_css . "\n";
}
// Output styles
if ($output <> '') {
$output = "\n\n";
echo $output;
}
}
add_action('wp_head', 'akyra_of_head_css');
// Adding breadcrumbs
function akyra_breadcrumbs() {
echo '
'. __('Home','akyra');
echo "";
if (is_attachment()) {
echo "". __('attachment:','akyra');
echo "";
}
if (is_category() || is_single()) {
if(is_category())
{
echo "". __('Category By:','akyra');
the_category(' • ');
echo "";
}
if (is_single()) {
echo "";
$category = get_the_category();
echo ''.$category[0]->cat_name.'';
echo "";
echo "";
the_title();
echo "";
}
} elseif (is_page()) {
echo "";
echo the_title();
echo "";
} elseif (is_search()) {
echo "". __('Search Results for...','akyra');
echo '"';
echo the_search_query();
echo '"';
echo "";
} elseif (is_tag()) { echo ""; single_tag_title(); echo "";}
elseif (is_day()) {echo"". __('Archive for ','akyra'); the_time('F jS, Y'); echo'';}
elseif (is_month()) {echo"". __('Archive for ','akyra'); the_time('F, Y'); echo'';}
elseif (is_year()) {echo"". __('Archive for ','akyra'); the_time('Y'); echo'';}
elseif (is_author()) {echo"". __('Author Archive for ','akyra'); printf(__(' %s', 'akyra'), "" . get_the_author() . ""); echo'';}
elseif (!is_single() && !is_page() && get_post_type() != 'post') {
$post_type = get_post_type_object(get_post_type());
//echo $before . $post_type->labels->singular_name . $after;
echo ''. __('Search Results for "','akyra').'' . get_search_query() . '"' ; echo "";
}
}
if ( ! function_exists( 'akyra_entry_meta' ) ) :
/**
* Set up post entry meta.
*
* Meta information for current post: categories, tags, permalink, author, and date.
**/
function akyra_entry_meta() {
$category_list = get_the_category_list( __( ', ', 'akyra' ) );
$tag_list = get_the_tag_list( '', __( ', ', 'akyra' ) );
$date = sprintf( '',
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
$author = sprintf( '%3$s',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'akyra' ), get_the_author() ) ),
get_the_author()
);
if ( $tag_list ) {
$utility_text = _x( ' Posted in : %1$s on %3$s
by : %4$s
', 'akyra' );
} elseif ( $category_list ) {
$utility_text = _x( ' Posted in : %1$s on %3$s
by : %4$s
', 'akyra' );
} else {
$utility_text = _x( ' Posted on : %3$s
by : %4$s
', 'akyra' );
}
printf(
$utility_text,
$category_list,
$tag_list,
$date,
$author
);
}
endif;
/**********************************/
function akyra_special_nav_class( $classes, $item )
{
$classes[] = 'special-class';
return $classes;
}
add_filter( 'nav_menu_css_class', 'akyra_special_nav_class', 10, 2 );
/**
* Register akyra widget areas.
*
*/
function akyra_widgets_init() {
register_sidebar( array(
'name' => __( 'Content Sidebar', 'akyra' ),
'id' => 'content-sidebar',
'description' => __( 'Additional sidebar that appears on the right.', 'akyra' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'akyra_widgets_init' );
/* akyra Theme End */
/*
* Add Active class to Wp-Nav-Menu
*/
function akyra_active_nav_class($classes, $item){
if( in_array('page_item', $classes) ){
$classes[] = 'active ';
}
return $classes;
}
add_filter('nav_menu_css_class' , 'akyra_active_nav_class' , 10 , 2);
function akyra_add_nav_class($output) {
$output= preg_replace('/