', esc_url(get_bloginfo('pingback_url'))); } } add_action('wp_head', 'bigmart_pingback_header'); /** Add Custom Classes to Body */ add_filter('body_class', 'bigmart_body_classes'); if (!function_exists('bigmart_body_classes')) { function bigmart_body_classes($classes) { // Adds a class of hfeed to non-singular pages. $classes[] = 'bigmart-theme'; if (!is_singular()) { $classes[] = 'hfeed'; } /** Website Layout */ $website_layout = get_theme_mod('bigmart_website_layout', 'wide'); if ($website_layout) { $classes[] = 'ms-' . esc_attr($website_layout); } /** Sidebar Class */ $page_layout = $blog_layout = $post_layout = ''; if (is_singular('page')) { global $post; $sidebar_layout = get_post_meta($post->ID, 'bigmart_sidebar_layout', true); $page_layout = ($sidebar_layout == 'default' || $sidebar_layout == '') ? get_theme_mod('bigmart_page_layout', 'right-sidebar') : $sidebar_layout; } elseif (is_singular('post')) { global $post; $sidebar_layout = get_post_meta($post->ID, 'bigmart_sidebar_layout', true); $page_layout = ($sidebar_layout == 'default' || $sidebar_layout == '') ? get_theme_mod('bigmart_post_layout', 'right-sidebar') : $sidebar_layout; $post_layout = get_bigmart_single_layout(); } elseif (is_home()) { $page_layout = get_theme_mod('bigmart_home_blog_layout', 'right-sidebar'); $blog_layout = get_theme_mod('bigmart_blog_layout', 'blog-layout1'); } elseif (class_exists('woocommerce') && is_woocommerce()) { if (apply_filters('bigmart_display_woo_class', '__return_true')) { $page_layout = get_theme_mod('bigmart_shop_layout', 'right-sidebar'); } } elseif (is_archive() && !is_search()) { $page_layout = get_theme_mod('bigmart_archive_layout', 'right-sidebar'); $blog_layout = get_theme_mod('bigmart_blog_layout', 'blog-layout1'); } elseif (is_search()) { $page_layout = get_theme_mod('bigmart_search_layout', 'right-sidebar'); $blog_layout = get_theme_mod('bigmart_blog_layout', 'blog-layout1'); } if (is_front_page() && is_home()) { $page_layout = get_theme_mod('bigmart_home_blog_layout', 'right-sidebar'); $blog_layout = get_theme_mod('bigmart_blog_layout', 'blog-layout1'); } if (!empty($page_layout)) { $classes[] = esc_attr('ms-' . $page_layout); } if (!empty($blog_layout)) { $classes[] = esc_attr('ms-' . $blog_layout); } if (!empty($post_layout)) { $classes[] = esc_attr('ms-' . $post_layout); } global $post; $is_elementor_page = get_post_meta( $post->ID, '_elementor_edit_mode', true ); if( is_front_page() && $is_elementor_page ) { $classes[] = esc_attr('ms-remove-vertical-padding'); } return $classes; } } /** Exclude Categories */ add_filter('pre_get_posts', 'bigmart_exclude_categories'); if (!function_exists('bigmart_exclude_categories')) { function bigmart_exclude_categories($query) { $exclude_cat = get_theme_mod('bigmart_blog_cat', 0); if (!$exclude_cat) { return; } $exclude_cat_array = explode(',', esc_attr($exclude_cat)); if (is_array($exclude_cat_array)) { if ($query->is_home() || is_archive()) { $query->set('category__not_in', $exclude_cat_array); } return $query; } } }