id == 'widgets'){ add_action( 'admin_enqueue_scripts', 'bloger_media_uploader' ); wp_enqueue_script( 'uploader-script', get_template_directory_uri().'/inc/admin-panel/js/media-uploader.js', array(),false,true); wp_enqueue_media(); } } /** Exclude Categories from Blog Page **/ function bloger_exclude_category_from_blogpost($query) { $exclude_category = get_theme_mod('bloger_exclude_cat', ''); $ex_cats = explode(',', $exclude_category); array_pop($ex_cats); if ( $query->is_home() ) { $query->set('category__not_in', $ex_cats); } return $query; } add_filter('pre_get_posts', 'bloger_exclude_category_from_blogpost'); function bloger_numeric_posts_nav() { if( is_singular() ) return; global $wp_query; /** Stop execution if there's only 1 page */ if( $wp_query->max_num_pages <= 1 ) return; $paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1; $max = intval( $wp_query->max_num_pages ); /** Add current page to the array */ if ( $paged >= 1 ) $links[] = $paged; /** Add the pages around the current page to the array */ if ( $paged >= 3 ) { $links[] = $paged - 1; $links[] = $paged - 2; } if ( ( $paged + 2 ) <= $max ) { $links[] = $paged + 2; $links[] = $paged + 1; } echo '' . "\n"; } function bloger_custom_logo() { if(function_exists('get_custom_logo')){ if (get_custom_logo()){ echo get_custom_logo(); } else{ $site_tagline = get_theme_mod('header_textcolor'); if($site_tagline !== 'blank'){ ?>

0, 'exclude' => 1 ) ); $category_lists = array(); $category_lists[''] = __('Select Category', 'bloger'); foreach($categories as $category) : $category_lists[$category->term_id] = $category->name; endforeach; return $category_lists; } function bloger_post_lists(){ wp_reset_postdata(); $posts = get_posts(array('posts_per_page' => -1)); $post_lists = array(); $post_lists[] = __('Select post', 'bloger'); foreach($posts as $post) : $post_lists[$post->ID] = $post->post_title; endforeach; return $post_lists; }