get_template_directory_uri() . '/inc/kirki/',
'capability' => 'edit_theme_options',
'option_type' => 'option',
'option_name' => 'awada_theme_options',
'compiler' => array(),
'color_accent' => '#27bebe',
'width' => '23%',
'description' => __('Visit our site for more great Products.If you like this theme please rate us 5 star', 'awada'),
);
return $args;
}
add_filter('kirki/config', 'awada_customizer_config');
require get_template_directory() . '/customizer.php';
add_action('after_setup_theme', 'awada_theme_setup');
$awada_theme_options = awada_theme_options();
function awada_theme_setup()
{
global $content_width;
//content width
if (!isset($content_width)) $content_width = 1068; //px
//supports featured image
add_theme_support('post-thumbnails');
load_theme_textdomain('awada', get_template_directory() . '/lang');
// This theme uses wp_nav_menu() in one location.
register_nav_menu('primary', __('Primary Menu', 'awada'));
register_nav_menu('secondary', __('Secondary Menu', 'awada'));
// theme support
$args = array('default-color' => '#ffffff',);
add_theme_support('custom-background', $args);
add_theme_support('custom-header');
add_theme_support('automatic-feed-links');
add_theme_support('woocommerce');
add_theme_support('title-tag');
add_theme_support( 'custom-logo', array(
'height' => 50,
'width' => 150,
'flex-height' => true,
'flex-width' => true,
) );
add_image_size('awada_home_slider_bg_image', 1600, 499, true);
add_image_size('awada_blog_full_thumb', 1068, 515, true);
add_image_size('awada_blog_sidebar_thumb', 688, 350, true);
add_image_size('awada_blog_two_sidebar_thumb', 403, 205, true);
add_image_size('awada_blog_home_thumb', 308, 157, true);
add_image_size('awada_recent_widget_thumb', 120, 77, true);
}
// Read more tag to formatting in blog page
function awada_content_more($read_more)
{
return '
';
}
add_filter('the_content_more_link', 'awada_content_more');
// Replaces the excerpt "more" text by a link
function awada_excerpt_more($more)
{
return '' . __('Read More...', 'awada') . '';
}
add_filter('excerpt_more', 'awada_excerpt_more');
/*
* Awada widget area
*/
add_action('widgets_init', 'awada_widget');
function awada_widget()
{
/*sidebar*/
$awada_theme_options = awada_theme_options();
$col = 12 / (int)$awada_theme_options['footer_layout'];
register_sidebar(array(
'name' => __('Primary Sidebar Widget Area', 'awada'),
'id' => 'primary-sidebar',
'description' => __('Primary sidebar widget area', 'awada'),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
register_sidebar(array(
'name' => __('Secondary Sidebar Widget Area', 'awada'),
'id' => 'secondary-sidebar',
'description' => __('Secondary sidebar widget area', 'awada'),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
register_sidebar(array(
'name' => __('Footer Widget Area', 'awada'),
'id' => 'footer-widget',
'description' => __('Footer widget area', 'awada'),
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
));
}
/* Breadcrumbs */
function awada_breadcrumbs()
{
$delimiter = '';
$home = __('Home', 'awada'); // text for the 'Home' link
$before = ''; // tag before the current crumb
$after = ''; // tag after the current crumb
echo '';
global $post;
$homeLink = home_url();
echo '- ' . $home . '' . $delimiter;
if (is_category()) {
global $wp_query;
$cat_obj = $wp_query->get_queried_object();
$thisCat = $cat_obj->term_id;
$thisCat = get_category($thisCat);
$parentCat = get_category($thisCat->parent);
if ($thisCat->parent != 0)
echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . '
'));
echo $before . _e("Category ", 'awada') . ' ' . single_cat_title($delimiter, false) . '' . $after;
} elseif (is_day()) {
echo '- ' . get_the_time('Y') . '' . $delimiter . '
';
echo '- ' . get_the_time('F') . ' ' . $delimiter;
echo $before . get_the_time('d') . '
';
} elseif (is_month()) {
echo '- ' . get_the_time('Y') . '' . $delimiter;
echo $before . get_the_time('F') . '
';
} elseif (is_year()) {
echo $before . get_the_time('Y') . '';
} elseif (is_single() && !is_attachment()) {
if (get_post_type() != 'post') {
$post_type = get_post_type_object(get_post_type());
$slug = $post_type->rewrite;
echo '- ' . $post_type->labels->singular_name . ' ' . $delimiter;
echo $before . get_the_title() . '
';
} else {
$cat = get_the_category();
$cat = $cat[0];
//echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo $before . get_the_title() . '';
}
} elseif (!is_single() && !is_page() && get_post_type() != 'post') {
$post_type = get_post_type_object(get_post_type());
if($post_type==null){
echo $before . __('Nothing Found','awada') . $after;
}else{
echo $before . $post_type->labels->singular_name . $after;
}
} elseif (is_attachment()) {
$parent = get_post($post->post_parent);
$cat = get_the_category($parent->ID);
$cat = $cat[0];
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo '- ' . $parent->post_title . '' . $delimiter;
echo $before . get_the_title() . $after;
} elseif (is_page() && !$post->post_parent) {
echo $before . get_the_title() . $after;
} elseif (is_page() && $post->post_parent) {
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ($parent_id) {
$page = get_page($parent_id);
$breadcrumbs[] = '
- ' . get_the_title($page->ID) . '
';
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
foreach ($breadcrumbs as $crumb)
echo $crumb . ' ' . $delimiter . ' ';
echo $before . get_the_title() . $after;
} elseif (is_search()) {
echo $before . _e("Search results for ", 'awada') . get_search_query() . '"' . $after;
} elseif (is_tag()) {
echo $before . _e('Tag ', 'awada') . single_tag_title($delimiter, false) . $after;
} elseif (is_author()) {
global $author;
$userdata = get_userdata($author);
echo $before . _e("Articles posted by: ", 'awada') . $userdata->display_name . $after;
} elseif (is_404()) {
echo $before . _e("Error 404 ", 'awada') . $after;
}
echo '
';
}
/* Blog Pagination */
if (!function_exists('awada_pagination')) {
function awada_pagination() {
global $wp_query;
$big = 999999999; // need an unlikely integer
$pages = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'prev_next' => false,
'type' => 'array',
'prev_next' => TRUE,
'prev_text' => '«',
'next_text' => '»',
) );
if( is_array( $pages ) ) {
$paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged');
echo "";
}
}
}
/*** Post pagination ***/
function awada_pagination_link()
{ ?>
publish;
$blog_post_count = $awada_theme_options['blog_post_count'];
wp_enqueue_script('load-posts1', get_template_directory_uri() . '/js/load-more.js');
wp_localize_script('load-posts1', 'load_more_posts_variable1', array(
'counts_posts1' => $published_posts1,
'blog_post_count' => $blog_post_count,
)
);
}
// Comment Function
function awada_comments($comments, $args, $depth)
{
$GLOBALS['comment'] = $comments;
extract($args, EXTR_SKIP);
if ('div' == $args['style']) {
$add_below = 'comment';
} else {
$add_below = 'div-comment';
}
?>
id="comment-">
';
}
function awada_theme_wrapper_end()
{
echo '
';
echo '
';
}
/* TGMPA register */
add_action('tgmpa_register', 'awada_register_required_plugins');
function awada_register_required_plugins()
{
$plugins = array(
array(
'name' => 'Photo Video Gallery Master', // The plugin name.
'slug' => 'photo-video-gallery-master', // The plugin slug (typically the folder name).
'required' => false, // If false, the plugin is only 'recommended' instead of required.
),
array(
'name' => 'Ultimate Gallery Master', // The plugin name.
'slug' => 'ultimate-gallery-master', // The plugin slug (typically the folder name).
'required' => false, // If false, the plugin is only 'recommended' instead of required.
),
);
$config = array(
'id' => 'awada', // Unique ID for hashing notices for multiple instances of Awada.
'default_path' => '', // Default absolute path to bundled plugins.
'menu' => 'Awada-install-plugins', // Menu slug.
'parent_slug' => 'themes.php', // Parent menu slug.
'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used.
'has_notices' => true, // Show admin notices or not.
'dismissable' => true, // If false, a user cannot dismiss the nag message.
'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
'is_automatic' => false, // Automatically activate plugins after installation or not.
'message' => '', // Message to output right before the plugins table.
);
awada($plugins, $config);
}
?>
$add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
comment_approved == '0') { ?>