is_responsive_enabled = get_theme_mod( 'responsive', true ); add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) ); add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) ); add_action( 'widgets_init', array( $this, 'beevent_register_sidebars' ) ); add_action( 'init', array( $this, 'beevent_include_files' ),0); } public function wp_enqueue_scripts() { $this->beevent_css(); $this->beevent_js(); } public function beevent_css() { // Main Style.css File wp_enqueue_style('beevent-style', get_stylesheet_uri() ); wp_enqueue_style('bootstrap', BEEVENT_CSS_DIR_UIR.'bootstrap.min.css', array(), '3.3.7', 'all'); wp_enqueue_style('custome-style', BEEVENT_CSS_DIR_UIR.'beevent-style.css', array(), '4.2.0', 'all'); wp_enqueue_style('owl-carousel-slider', BEEVENT_CSS_DIR_UIR.'owl.carousel.css', array(), '2.2.0', 'all'); wp_enqueue_style('owl-transitions-style', BEEVENT_CSS_DIR_UIR.'owl.transitions.css', array(), '2.2.0', 'all'); wp_enqueue_style('font-awesome', BEEVENT_CSS_DIR_UIR.'font-awesome.min.css', array(), '4.7.0', 'all'); //////////////// wp_enqueue_style('pretty-Photo', BEEVENT_CSS_DIR_UIR.'prettyPhoto.css', array(), '3.1.6', 'all'); } public function beevent_js() { wp_enqueue_script('bootstrap-js', BEEVENT_JS_DIR_URI.'bootstrap.min.js', array('jquery' ), '3.3.7', true); wp_enqueue_script('owl-carousel-slider', BEEVENT_JS_DIR_URI.'owl.carousel.min.js', array('jquery' ), '2.2.0', true); wp_enqueue_script('beevent-custom', BEEVENT_JS_DIR_URI.'beevent-interface.js', array('jquery' ), '1.0.0', true); ////////// wp_enqueue_script('pretty-Photo', BEEVENT_JS_DIR_URI.'jquery.prettyPhoto.js', array('jquery' ), '3.1.6', true); } function is_admin() { if ( isset( $GLOBALS['current_screen'] ) ) return $GLOBALS['current_screen']->in_admin(); elseif ( defined( 'WP_ADMIN' ) ) return WP_ADMIN; return false; } public function beevent_include_files() { $this->beevent_theme_functions(); } /** * Functions called during each page load, after the theme is initialized * Perform basic setup, registration, and init actions for the theme * @since 1.0.0 */ public function after_setup_theme() { //add textdomain load_theme_textdomain('beevent', get_template_directory() . '/lang'); // Register navigation menus register_nav_menus ( array( 'primary'=> esc_html__('primary Menu','beevent'), 'secondary'=> esc_html__('Secondary Menu','beevent'), ) ); // Enable some useful post formats for the blog add_theme_support( 'post-formats', array( 'video', 'gallery', 'audio', 'quote', 'link' ) ); // Add automatic feed links in the header - for themecheck nagg add_theme_support( 'automatic-feed-links' ); // Enable featured image support add_theme_support( 'post-thumbnails' ); add_image_size( 'beevent_small', 300, 300, array( 'left', 'top' ) ); // And HTML5 support add_theme_support( 'html5' ); // Enable excerpts for pages. add_post_type_support( 'page', 'excerpt' ); // Title tag add_theme_support( 'title-tag' ); add_theme_support( "custom-background" ); add_theme_support( "custom-header" ) ; } public function beevent_register_sidebars(){ register_sidebar( array( 'name' => esc_html__('BeEvent Main Sidebar', 'beevent'), 'id' => 'beevent_main', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); } private function beevent_theme_functions() { require_once( BEEVENT_FUNCTION_DIR .'meta/meta-options.php'); require_once( BEEVENT_FUNCTION_DIR .'metacore/core-options.php'); require_once( BEEVENT_FUNCTION_DIR .'meta/post-meta/class.php'); require_once( BEEVENT_FUNCTION_DIR .'theme-options.php'); require_once( BEEVENT_FUNCTION_DIR .'blog-style.php'); require_once( BEEVENT_FUNCTION_DIR .'header-functions.php'); require_once( BEEVENT_FUNCTION_DIR .'footer-functions.php'); require_once( BEEVENT_FUNCTION_DIR .'social-share.php'); //Element File require_once( BEEVENT_FUNCTION_DIR .'element/speakers.php'); require_once( BEEVENT_FUNCTION_DIR .'element/schedule.php'); require_once( BEEVENT_FUNCTION_DIR .'element/sponsors.php'); require_once( BEEVENT_FUNCTION_DIR .'element/testimonial.php'); require_once( BEEVENT_FUNCTION_DIR .'element/gallery.php'); require_once( BEEVENT_FUNCTION_DIR .'classes/install-plugin.php' ); } /** * my site feed function * *https://wordpress.org/support/topic/custom-post-types */ public function beevent_myfeed_request($qv) { if (isset($qv['feed']) && !isset($qv['post_type'])) $qv['post_type'] = array('post', 'sponsor', 'speaker', 'testimonial', 'gallery', 'page'); return $qv; } } $beevent_theme_setup = new beevent_Theme_Setup(); /*Theme Option Framwork start ********/ function beevent_defaults( $id ){ $defaults = array( 'footer_facebook' =>esc_html__('','beevent'), 'footer_twitter' =>esc_html__('','beevent'), 'footer_linkedin' => esc_html__('','beevent'), 'site_favicon' => array('url' => esc_html__('','beevent')), 'site_logo' => array('url' => esc_html__('','beevent')), ); if( isset( $defaults[$id] ) ){ return $defaults[$id]; } else { return ''; } } /* get option from theme options */ function beevent_get_option($id){ global $beevent_options; if( isset( $beevent_options[$id] ) ){ $value = $beevent_options[$id]; if( isset( $value ) ){ return apply_filters( 'beevent_get_options', $value, $id ); } else { return apply_filters( 'beevent_get_options', '', $id ); } } else{ return apply_filters( 'beevent_get_options',beevent_defaults( $id ), $id ); } } /** Theme Option Framwork end***********/ /**********Paging Nav******/ if ( ! function_exists( 'beevent_paging_nav' ) ) : function beevent_paging_nav() { global $wp_query, $wp_rewrite; // Don't print empty markup if there's only one page. if ( $wp_query->max_num_pages < 2 ) { return; } $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; $pagenum_link = html_entity_decode( get_pagenum_link() ); $query_args = array(); $url_parts = explode( '?', $pagenum_link ); if ( isset( $url_parts[1] ) ) { wp_parse_str( $url_parts[1], $query_args ); } $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; $format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%'; // Set up paginated links. $links = paginate_links( array( 'base' => $pagenum_link, 'format' => $format, 'total' => $wp_query->max_num_pages, 'current' => $paged, 'mid_size' => 1, 'add_args' => array_map( 'urlencode', $query_args ), 'prev_text' => esc_html__( 'Previous', 'beevent' ), 'next_text' => esc_html__( 'Next', 'beevent' ), ) ); if ( $links ) : ?> max_num_pages; } else { $total = $wp_query->max_num_pages; } $big = 999999999; if( $total > 1 ) { if( !$current_page = get_query_var('paged') ) $current_page = 1; if( get_option('permalink_structure') ) { $format = 'page/%#%/'; } else { $format = '&paged=%#%'; } echo paginate_links(array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => $format, 'current' => max( 1, get_query_var('paged') ), 'total' => $total, 'mid_size' => 3, 'type' => 'list', 'prev_text' => $prev_arrow, 'next_text' => $next_arrow, ) ); } } } if ( ! function_exists( 'beevent_post_nav' ) ) : function beevent_post_nav() { global $post; $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; ?> 1 && get_option( 'page_comments' ) ) : ?> urlencode( implode( '|', $font_families ) ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); endif; //Lato font family elseif($font_style=='Lato'): if ('off' !== $Lato): $font_families = array(); if ('off' !== $Lato ) { $font_families[] = 'Lato:300,400,700,900'; } $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); endif; //OpenSans font family elseif($font_style=='OpenSans'): if ('off' !== $OpenSans): $font_families = array(); if ('off' !== $OpenSans ) { $font_families= 'Open+Sans:300,400,600,700,800'; } $query_args = array( 'family' => $font_families, ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); endif; //MartelSans font family elseif($font_style=='MartelSans'): if ('off' !== $MartelSans): $font_families = array(); if ('off' !== $MartelSans ) { $font_families= 'Martel+Sans:400,600,700,800'; } $query_args = array( 'family' => $font_families, ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); endif; //Roboto font family else: $Roboto = esc_attr_x( 'on', 'Roboto font: on or off', 'beevent' ); if ('off' !== $Roboto): $font_families = array(); if ('off' !== $Roboto ) { $font_families[] = 'Roboto:300,400,500,700,900'; } $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); endif; endif; return esc_url_raw( $fonts_url ); } /*Enqueue scripts and styles.*/ function beevent_add_google_fonts() { wp_enqueue_style( 'beevent-fonts', beevent_fonts_url(), array(), '1.0.0' ); } add_action( 'wp_enqueue_scripts', 'beevent_add_google_fonts' ); /* Javascript Google Fonts Url Function Start */ function SearchFilter($query) { if ($query->is_search) { $query->set('post_type', 'post'); } return $query; } function beevent_enqueue_comments_reply() { // on single blog post pages with comments open and threaded comments if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { // enqueue the javascript that performs in-link comment reply fanciness wp_enqueue_script( 'comment-reply' ); } } // Hook into wp_enqueue_scripts add_action( 'comment_form_before', 'beevent_enqueue_comments_reply' ); // Header if(is_admin()){ if(!class_exists('CsCoreControl')){ /* add mete core */ require_once( BEEVENT_FUNCTION_DIR .'metacore/core-options.php'); /* add meta options */ require_once( BEEVENT_FUNCTION_DIR .'meta/meta-options.php'); } } // Excerpt function beevent_excerpt( $len=15, $trim = "…" ) { $limit = $len+1; $excerpt = explode( ' ', get_the_excerpt(), $limit ); $num_words = count( $excerpt ); if ( $num_words >= $len ) { $last_item = array_pop( $excerpt ); } else { $trim=""; } $excerpt = implode( " ", $excerpt ) . $trim ; return $excerpt; } // Scripts File function beevent_scripts_basic() { wp_enqueue_script('jquery-plugin', BEEVENT_JS_DIR_URI .'jquery.plugin.min.js'); wp_enqueue_script('jquery-countdown', BEEVENT_JS_DIR_URI .'jquery.countdown.min.js'); } add_action( 'wp_enqueue_scripts', 'beevent_scripts_basic' ); /** * Get meta data. */ function beevent_meta_data(){ global $post, $beevent_meta; if(!isset($post->ID)) return ; $beevent_meta = json_decode(get_post_meta($post->ID, '_cms_meta_data', true)); if(empty($beevent_meta)) return ; foreach ($beevent_meta as $key => $meta){ $beevent_meta->$key = rawurldecode($meta); } } add_action('wp', 'beevent_meta_data'); /** * Get post meta data. */ function beevent_post_meta_data($post_id = null){ global $post; if(!$post_id){ if(isset($post->ID)){ $post_id=$post->ID; }else{ return null; } } $post_meta = json_decode(get_post_meta($post_id, '_cms_meta_data', true)); if(empty($post_meta)) return null; foreach ($post_meta as $key => $meta){ $post_meta->$key = rawurldecode($meta); } return $post_meta; } // Sub Menu li add Class dropdown togal function beevent_menu_set_dropdown( $sorted_menu_items ) { $last_top = 0; foreach ( $sorted_menu_items as $key => $obj ) { // it is a top lv item? if ( 0 == $obj->menu_item_parent ) { // set the key of the parent $last_top = $key; } else { $sorted_menu_items[$last_top]->classes['dropdown'] = 'dropdown'; } } return $sorted_menu_items; } add_filter( 'wp_nav_menu_objects', 'beevent_menu_set_dropdown'); // Menu li a tag add Class js-target-scroll Togal function beevent_add_nav_class($output) { $output= preg_replace('/'. ( $beevent_req ? '*' : '' ) . ''; $beevent_fields['email'] = '
' . '' . ($beevent_req ? '*' : '') . '
'; $beevent_fields['url'] = '
' . ' ' . '
'; return $beevent_fields; } add_filter('comment_form_default_fields','beevent_comment_form_fields'); // contact form 7 function beevent_form_elements($html) { $text = esc_html('Select Option', 'beevent'); $html = str_replace('---', $text , $html); return $html; } add_filter('wpcf7_form_elements', 'beevent_form_elements');