$val) { $id = $val->ID; if ($img_size == 'large') { $img_arr = wp_get_attachment_image_src($id, 'full'); // THE FULL SIZE IMAGE INSTEAD $imgarr['id'] = $id; $imgarr['file'] = $img_arr[0]; $return_arr[] = $imgarr; } elseif ($img_size == 'medium') { $img_arr = wp_get_attachment_image_src($id, 'medium'); //THE medium SIZE IMAGE INSTEAD $imgarr['id'] = $id; $imgarr['file'] = $img_arr[0]; $return_arr[] = $imgarr; } elseif ($img_size == 'thumb') { $img_arr = wp_get_attachment_image_src($id, 'thumbnail'); // Get the thumbnail url for the attachment $imgarr['id'] = $id; $imgarr['file'] = $img_arr[0]; $return_arr[] = $imgarr; }elseif ($img_size == 'homeslide') { $img_arr = wp_get_attachment_image_src($id, 'homeslide'); // Get the thumbnail url for the attachment $imgarr['id'] = $id; $imgarr['file'] = $img_arr[0]; $return_arr[] = $imgarr; }elseif ($img_size == 'professor_thumb') { $img_arr = wp_get_attachment_image_src($id, 'professor_thumb'); // Get the thumbnail url for the attachment $imgarr['id'] = $id; $imgarr['file'] = $img_arr[0]; $return_arr[] = $imgarr; }elseif ($img_size == 'blog_detail_medium') { $img_arr = wp_get_attachment_image_src($id, 'blog_detail_medium'); // Get the thumbnail url for the attachment $imgarr['id'] = $id; $imgarr['file'] = $img_arr[0]; $return_arr[] = $imgarr; }elseif ($img_size == 'blog_list_thumb') { $img_arr = wp_get_attachment_image_src($id, 'blog_list_thumb'); // Get the thumbnail url for the attachment $imgarr['id'] = $id; $imgarr['file'] = $img_arr[0]; $return_arr[] = $imgarr; }elseif ($img_size == 'facilities_img') { $img_arr = wp_get_attachment_image_src($id, 'facilities_img'); // Get the thumbnail url for the attachment $imgarr['id'] = $id; $imgarr['file'] = $img_arr[0]; $return_arr[] = $imgarr; }elseif ($img_size == 'widget_img') { $img_arr = wp_get_attachment_image_src($id, 'widget_img'); // Get the thumbnail url for the attachment if (!$img_arr) { $img_arr = wp_get_attachment_image_src($id, 'thumbnail'); // Get the thumbnail url for the attachment } $imgarr['id'] = $id; $imgarr['file'] = $img_arr[0]; $return_arr[] = $imgarr; } } } return $return_arr; } /**-- Function to fetch images EOF --**/ /* ======================= UNREGISTER MENU AREA ============================== */ /** * */ function rainbow_unregister_menus() { unregister_nav_menu('header-horizontal'); unregister_nav_menu('header-secondary'); //unregister_nav_menu('footer'); unregister_nav_menu('header-primary'); unregister_nav_menu('subsidiary'); } /**-- Function to het different header per page --**/ /** * */ function rainbow_header_function() { $call_no = education_hybrid_get_setting( 'contact_no_with_menu' ); $navigation = get_option('supreme_theme_settings'); $navigation_setting = education_hybrid_get_setting('navigation'); ?>

post_type; $pt_metaboxes = get_post_custom_fields_templ($post_type); $output = ''; if ($pt_metaboxes) { if (get_post_meta($post->ID, 'remote_ip', true) != "") { $remote_ip = get_post_meta($post->ID, 'remote_ip', true); } else { $remote_ip= getenv("REMOTE_ADDR"); } if (get_post_meta($post->ID, 'ip_status', true) != "") { $ip_status = get_post_meta($post->ID, 'ip_status', true); } else { $ip_status= '0'; } echo '
'."\n"; echo ''."\n"; echo ''."\n"; echo ' '."\n"; echo ' '; foreach ($pt_metaboxes as $pt_id => $pt_metabox) { if ($pt_metabox['type'] == 'text' or $pt_metabox['type'] == 'select' or $pt_metabox['type'] == 'radio' or $pt_metabox['type'] == 'checkbox' or $pt_metabox['type'] == 'textarea' or $pt_metabox['type'] == 'upload' or $pt_metabox['type'] == 'date' or $pt_metabox['type'] == 'multicheckbox' or $pt_metabox['type'] == 'texteditor') $pt_metaboxvalue = get_post_meta($post->ID, $pt_metabox["name"], true); if ($pt_metaboxvalue == "" || !isset($pt_metaboxvalue)) { $pt_metaboxvalue = $pt_metabox['default']; } if ($pt_metabox['type'] == 'text') { echo "\t".'
'; echo "\t\t".'

'."\n"; echo "\t\t".'

'."\n"; echo "\t\t".'

'.$pt_metabox['desc'].'

'."\n"; echo "\t".'
'."\n"; } elseif ($pt_metabox['type'] == 'textarea') { echo "\t".'
'; echo "\t\t".'

'."\n"; echo "\t\t".'

'."\n"; echo "\t\t".'

'.$pt_metabox['desc'].'

'."\n"; echo "\t".'
'."\n"; } elseif ($pt_metabox['type'] == 'select') { echo "\t".'
'; echo "\t\t".'

'."\n"; echo "\t\t".'

'.$pt_metabox['desc'].'

'."\n"; echo "\t".'
'."\n"; } elseif ($pt_metabox['type'] == 'date') { echo "\t".'
'; echo "\t\t".'

'."\n"; echo "\t\t".'

Calendar

'."\n"; echo "\t\t".'

'.$pt_metabox['desc'].'

'."\n"; echo "\t".'
'."\n"; } elseif ($pt_metabox['type'] == 'radio') { echo "\t".'
'; echo "\t\t".'

'."\n"; $array = $pt_metabox['options']; if ($array) { foreach ( $array as $id => $option ) { $checked=''; if ($pt_metabox['default'] == $option) {$checked = 'checked="checked"';} if (trim($pt_metaboxvalue) == trim($option)) {$checked = 'checked="checked"';} echo "\t\t".'

 '.$option.'

'."\n"; } } echo '

'.$pt_metabox['desc'].'

'."\n"; echo "\t".'
'."\n"; } elseif ($pt_metabox['type'] == 'checkbox') { if ($pt_metaboxvalue == '1') { $checked = 'checked="checked"';} else {$checked='';} echo "\t".'
'; echo "\t\t".'

'."\n"; echo "\t\t".'

'."\n"; echo "\t\t".''.$pt_metabox['desc'].'

'."\n"; echo "\t".'
'."\n"; }else { } } } echo "
"; } } /**----- Function to add contents of metabox BOF ------**/ if (!function_exists('ptthemes_metabox_insert')) { /** * * @param unknown $post_id * @return unknown */ function ptthemes_metabox_insert($post_id) { global $globals; // verify nonce if (!wp_verify_nonce(@$_POST['templatic_meta_box_nonce'], basename(__FILE__))) { return $post_id; } // check autosave if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return $post_id; } $pt_metaboxes = get_post_custom_fields_templ($_POST['post_type']); $pID = $_POST['post_ID']; $counter = 0; foreach ($pt_metaboxes as $pt_metabox) { // On Save.. this gets looped in the header response and saves the values submitted if ($pt_metabox['type'] == 'text' or $pt_metabox['type'] == 'select' or $pt_metabox['type'] == 'checkbox' or $pt_metabox['type'] == 'textarea' or $pt_metabox['type'] == 'radio' or $pt_metabox['type'] == 'upload' or $pt_metabox['type'] == 'date' or $pt_metabox['type'] == 'multicheckbox' or $pt_metabox['type'] == 'geo_map' or $pt_metabox['type'] == 'texteditor') // Normal Type Things... { $var = $pt_metabox["name"]; add_post_meta($pID, $pt_metabox["name"], $_POST[$var], true ); if ( get_post_meta( $pID, $pt_metabox["name"] ) == "" ) { add_post_meta($pID, $pt_metabox["name"], $_POST[$var], true ); } elseif ($_POST[$var] != get_post_meta($pID, $pt_metabox["name"], true)) update_post_meta($pID, $pt_metabox["name"], $_POST[$var]); elseif ($_POST[$var] == "") delete_post_meta($pID, $pt_metabox["name"], get_post_meta($pID, $pt_metabox["name"], true)); if ( get_post_meta( $pID, 'remote_ip' ) == "" ) add_post_meta($pID, 'remote_ip', $_POST['remote_ip'], true ); elseif ($_POST['remote_ip'] != get_post_meta($pID, 'remote_ip', true)) update_post_meta($pID, 'remote_ip', $_POST['remote_ip']); elseif ($_POST['remote_ip'] == "") delete_post_meta($pID, 'remote_ip', get_post_meta($pID, 'remote_ip', true)); if ( get_post_meta( $pID, 'ip_status' ) == "" ) add_post_meta($pID, 'ip_status', $_POST['ip_status'], true ); elseif ($_POST['ip_status'] != get_post_meta($pID, 'ip_status', true)) update_post_meta($pID, 'ip_status', $_POST['ip_status']); elseif ($_POST['ip_status'] == "") { delete_post_meta($pID, 'ip_status', get_post_meta($pID, 'ip_status', true));} elseif ($_POST['featured_type'] != get_post_meta($pID, 'featured_type', true)) { if ($_POST['featured_type']): if ($_POST['featured_type'] == 'both'): update_post_meta($pID, 'featured_c', 'c'); update_post_meta($pID, 'featured_h', 'h'); update_post_meta($pID, 'featured_type', $_POST['featured_type']); endif; if ($_POST['featured_type'] == 'c'): update_post_meta($pID, 'featured_c', 'c'); update_post_meta($pID, 'featured_h', 'n'); update_post_meta($pID, 'featured_type', $_POST['featured_type']); endif; if ($_POST['featured_type'] == 'h'): update_post_meta($pID, 'featured_h', 'h'); update_post_meta($pID, 'featured_c', 'n'); update_post_meta($pID, 'featured_type', $_POST['featured_type']); endif; if ($_POST['featured_type'] == 'none'): update_post_meta($pID, 'featured_h', 'n'); update_post_meta($pID, 'featured_c', 'n'); update_post_meta($pID, 'featured_type', $_POST['featured_type']); endif; else: update_post_meta($pID, 'featured_type', 'none'); update_post_meta($pID, 'featured_c', 'n'); update_post_meta($pID, 'featured_h', 'n'); endif; } } } } } if (!function_exists('ptthemes_meta_box')) { /** * */ function ptthemes_meta_box() { $post_types_in = array('course', 'staff', 'gallery'); $custom_post_types_args = array(); $custom_post_types = get_post_types($custom_post_types_args, 'objects'); foreach ($custom_post_types as $content_type) { if ($content_type->name!='nav_menu_item' && $content_type->name!='attachment' && $content_type->name!='revision' && $content_type->name!='page' && $content_type->name!='post') { $post_types = $content_type->name; $pt_metaboxes = get_post_custom_fields_templ($post_types, '0', 'admin_side'); if ( function_exists('add_meta_box')) { if (in_array($post_types, $post_types_in) && $pt_metaboxes) { apply_filters('templ_admin_post_type_custom_filter', add_meta_box('ptthemes-settings', apply_filters('templ_admin_post_custom_fields_title_filter', 'Custom Settings'), 'ptthemes_meta_box_content', $post_types, 'normal', 'high', array( 'post_types' => $post_types))); } } } } } } add_action('admin_menu', 'ptthemes_meta_box'); add_action('save_post', 'ptthemes_metabox_insert'); /** * * @param unknown $post_types * @param unknown $category_id (optional) * @param unknown $show_on_page (optional) * @param unknown $is_search (optional) * @return unknown */ function get_post_custom_fields_templ($post_types, $category_id='', $show_on_page = '', $is_search = '') { global $wpdb, $custom_post_meta_db_table_name; $custom_post_meta_db_table_name = $wpdb->prefix."templatic_custom_post_fields"; $custom_fields_prepare = ''; $post_query = ''; if ($show_on_page != '') { $custom_fields_prepare = $show_on_page; } else { $custom_fields_prepare = 'admin_side'; } $is_search_prepare = ''; if ($is_search != '') { $post_query .= " and is_search = %s"; $is_search_prepare = '1'; } /*if($category_id != '0' && $category_id != '' ){ $post_query .= " and (field_category LIKE '%,".$category_id.",%' or field_category LIKE '%,".$category_id."' or field_category LIKE '%".$category_id.",%' or field_category LIKE '%".$category_id."%' or field_category = '0')"; } */ $post_query .= " order by sort_order asc,cid asc"; $post_meta_info = $wpdb->get_results($wpdb->prepare("select * from $custom_post_meta_db_table_name where is_active=%d and (post_type = %s or post_type=%s) and (show_on_page = %s or show_on_page = %s) $post_query ", 1, $post_types, 'both', $custom_fields_prepare, 'both_side', $is_search_prepare)); $return_arr = array(); if ($post_meta_info) { foreach ($post_meta_info as $post_meta_info_obj) { if ($post_meta_info_obj->ctype) { $options = explode(',', $post_meta_info_obj->option_values); } $custom_fields = array( "name" => $post_meta_info_obj->htmlvar_name, "label" => $post_meta_info_obj->clabels, "field_category" => $post_meta_info_obj->field_category, "htmlvar_name" => $post_meta_info_obj->htmlvar_name, "default" => $post_meta_info_obj->default_value, "type" => $post_meta_info_obj->ctype, "desc" => $post_meta_info_obj->admin_desc, "option_values" => $post_meta_info_obj->option_values, "site_title" => $post_meta_info_obj->site_title, "is_require" => $post_meta_info_obj->is_require, "is_active" => $post_meta_info_obj->is_active, "show_on_listing" => $post_meta_info_obj->show_on_listing, "show_on_detail" => $post_meta_info_obj->show_on_detail, "validation_type" => $post_meta_info_obj->validation_type, "style_class" => $post_meta_info_obj->style_class, "extra_parameter" => $post_meta_info_obj->extra_parameter, ); if ($options) { $custom_fields["options"]=$options; } $return_arr[$post_meta_info_obj->htmlvar_name] = $custom_fields; } } return $return_arr; } /** CUSTOM METABOXES END **/ /* Function to fetch category name EOF */ add_action('admin_menu', 'templ_add_admin_menu_education'); add_action( 'init', 'templ_add_my_stylesheet' ); add_action('templ_add_admin_menu_education', 'templ_add_mainadmin_menu_education', 0); /***-- Add menu at admin side BOF --**/ /** * */ function templ_add_admin_menu_education() { do_action('templ_add_admin_menu_education'); } /** * */ function templ_add_mainadmin_menu_education() { $menu_title = __('Manage custom fields', 'templatic'); if (function_exists('add_object_page')) { add_menu_page("Admin Menu", $menu_title, 'administrator', 'manage_custom_fields', 'manage_custom_fields', get_stylesheet_directory_uri().'/images/favicon.ico', 40); // title of new sidebar }else { add_menu_page("Admin Menu", $menu_title, 'administrator', 'templatic_wp_admin_menu', 'design', get_stylesheet_directory_uri().'/images/favicon.ico', 40); // title of new sidebar } } /***-- Add menu at admin side EOF --**/ /** function to include custom fields files BOF **/ function manage_custom_fields() { if (@$_REQUEST['mod'] == 'custom_fields') { include_once TEMPLATE_MODULES_FOLDER_PATH.'manage_custom_fields/admin_manage_custom_fields_edit.php'; } else { include TEMPLATE_MODULES_FOLDER_PATH.'manage_custom_fields/admin_manage_custom_fields_list.php'; } } /** function to include custom fields files EOF **/ /** * function to fetch validation types BOF * * * @param unknown $validation_type (optional) * @return unknown */ function validation_type_cmb($validation_type = '') { $validation_type_display = ''; $validation_type_array = array(" "=>"Select validation type", "require"=>"Require", "phone_no"=>"Phone No.", "digit"=>"Digit", "email"=>"Email"); foreach ($validation_type_array as $validationkey => $validationvalue) { if ($validation_type == $validationkey) { $vselected = 'selected'; } else { $vselected = ''; } $validation_type_display .= ''; } return $validation_type_display; } /** function to fetch validation types EOF **/ /** Remove custom fields metabox of wordpress **/ function remove_post_custom_fields() { remove_meta_box( 'postcustom' , CUSTOM_POST_TYPE1 , 'normal' ); remove_meta_box( 'postcustom' , CUSTOM_POST_TYPE2 , 'normal' ); } add_action( 'admin_menu' , 'remove_post_custom_fields' ); /*-- ENter nivo slider url BOF --*/ /**-- Function to include javascript BOF --**/ /** * */ function add_nivoslider_js() { wp_enqueue_script('nivoslider', get_stylesheet_directory_uri()."/js/jquery.nivo.slider.pack.js"); wp_enqueue_script('bxslider', get_stylesheet_directory_uri()."/js/jquery.bxSlider.min.js");?>
Application';} if ($app_link != "" && $app_link == 1) { ?>

get_var($wpdb->prepare("select `post_title` from $wpdb->posts where `ID` = %d and `post_type` = %s", $_REQUEST['page_id'], 'page')); echo ucwords($title_page); } ?>

get_queried_object(); echo "

".$current_term->name."

"; } // if ( current_theme_supports( 'breadcrumb-trail' ) && !isset($_REQUEST['ptype']) && @$_REQUEST['ptype'] =='' && hybrid_get_setting('supreme_show_breadcrumb')) { if ( current_theme_supports( 'breadcrumb-trail' ) && !isset($_REQUEST['ptype']) && hybrid_get_setting('supreme_show_breadcrumb')) { breadcrumb_trail( array( 'before' => '', 'separator' => '::' ) ); }elseif (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] !='') { ?>

post_excerpt != "") { echo "

".$post->post_excerpt."

"; }else { if ($post->post_type != 'gallery') { $excerpt = substr($post->post_content, 0, 75); //echo '

'.$excerpt.'

'; } } } if (is_tax() || is_category()) { ?> get_queried_object(); echo $current_term->description; } ?>

'ids'); $args = wp_parse_args( $args, $defaults ); $cats = wp_get_object_terms($post_id, $taxonomy, $args); return $cats; } /** * * @param unknown $post */ function templa_get_post_categories($post) { global $post; $post_type = $post->post_type; $post_id = $post->ID; $Categories = ""; $taxonomy = ""; if ($post_type == CUSTOM_POST_TYPE1) { $post_categories = wp_get_tax_categories($post_id, '', CUSTOM_CATEGORY_TYPE1); $taxonomy = CUSTOM_CATEGORY_TYPE1; }else if ($post_type == CUSTOM_POST_TYPE2) { $post_categories = wp_get_tax_categories($post_id, '', CUSTOM_CATEGORY_TYPE2); $taxonomy = CUSTOM_CATEGORY_TYPE2; }else if ($post_type == CUSTOM_POST_TYPE4) { $post_categories = wp_get_tax_categories($post_id, '', CUSTOM_CATEGORY_TYPE4); $taxonomy = CUSTOM_CATEGORY_TYPE4; }else { $post_categories = wp_get_tax_categories($post_id, '', 'category'); $taxonomy = 'category'; } foreach ($post_categories as $c) { $cat = get_term( $c, $taxonomy ); $cats[] = array( 'name' => $cat->name, 'slug' => $cat->slug ); } $taxonomy_category = ""; $cats = isset($cats) ? $cats : array(); for ($t = 0 ; $t < count($cats) ; $t++) { if ($t == count($cats)-1) { $sep=''; }else { $sep=', '; } $cats2 = "".$cats[$t]['name']."".$sep; $taxonomy_category .= $cats2; } if (($post_type == 'gallery' && $_REQUEST['gallery'] != "")) { $taxonomy_category = ucwords($_REQUEST['gallery']); } if (($post_type == 'staff' && $_REQUEST['staff'] != "")) { $taxonomy_category = ucwords($_REQUEST['staff']); } if ( isset($_REQUEST['attachment_id'] )) { $taxonomy_category = _e(ucwords('gallery'), 'templatic'); } if ($taxonomy_category != '') { echo $taxonomy_category; } } /**-- To fetch categoties EOF --**/ /**-- create auto install BOF --**/ /** * * @return unknown */ function templ_is_auto_install() { if (strtolower(get_option('ptthemes_auto_install'))=='yes') { return true; } return false; } /**-- create auto install EOF --**/ /**-- Filtering for taxonomy pages BOF --**/ $attribute = isset($_REQUEST['course_t']) ? $_REQUEST['course_t'] : ""; if (!strstr($_SERVER['REQUEST_URI'], '/wp-admin/') && ($attribute !='' || isset($_SESSION['attribute']))) { add_action('posts_where', 'searching_filter_where'); }else if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'gallery') { add_action('posts_where', 'gallery_filter_where'); } /** * * @return unknown */ function facilities_filter_where() { global $wpdb; $where =''; $where .= " AND $wpdb->posts.post_type ='facilities' AND $wpdb->posts.post_status ='publish'"; return $where; } /** * * @return unknown */ function gallery_filter_where() { global $wpdb; $where =''; $where .= " AND $wpdb->posts.post_type ='gallery' AND post_status ='Publish'"; return $where; } /** * * @return unknown */ function staff_filter_where() { global $wpdb; $where =''; $where .= " AND $wpdb->posts.post_type ='".CUSTOM_POST_TYPE2."' AND post_status ='Publish'"; return $where; } /** * * @return unknown */ function course_filter_where() { global $wpdb, $wp_query; $where .= " AND $wpdb->posts.post_type ='".CUSTOM_POST_TYPE1."' AND post_status ='publish'"; return $where; } /**--- Function for search listing BOF ---**/ /** * * @return unknown */ function searching_filter_where() { global $wpdb, $post, $wp_query; $attribute = @$_REQUEST['attribute']; $course = @$_REQUEST['course_t']; $search = get_search_query(); if ($attribute) { $_SESSION['attribute'] = $attribute; }elseif ($_REQUEST['submit'] == 'Search') { unset($_SESSION['attribute']); }else { unset($_SESSION['attribute']); } if ($_SESSION['attribute'] !='' ) { $where .= " AND $wpdb->posts.post_type ='".CUSTOM_POST_TYPE1."' AND ($wpdb->posts.ID in (SELECT post_id FROM $wpdb->postmeta where `meta_key` LIKE '%".$_SESSION['attribute']."%' AND `meta_value` LIKE '%".$search."%'))"; }else if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == CUSTOM_POST_TYPE2) { @$where .= " AND $wpdb->posts.post_type ='".CUSTOM_POST_TYPE2."'"; }else if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == CUSTOM_POST_TYPE4) { $where .= " AND $wpdb->posts.post_type ='".CUSTOM_POST_TYPE4."'"; }else if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == CUSTOM_POST_TYPE3) { $where .= " AND $wpdb->posts.post_type ='".CUSTOM_POST_TYPE3."'"; }else { if (is_search()) { if ($course) { $where .= " AND ($wpdb->posts.post_title LIKE '%".$search."%' OR $wpdb->posts.post_content LIKE '%".$search."%') AND $wpdb->posts.post_type='course' AND $wpdb->posts.post_status='publish'"; }else { $where .= " AND ($wpdb->posts.post_title LIKE '%".$search."%' OR $wpdb->posts.post_content LIKE '%".$search."%') AND $wpdb->posts.post_type='post' AND $wpdb->posts.post_status='publish'"; } } } return $where; } /**-- Filtering for taxonomy pages EOF --**/ /** * */ function templatic_theme_validate_settings() { $input['app_link'] = wp_filter_nohtml_kses( $input['app_link'] ); $input['app_link_title'] = wp_filter_nohtml_kses( $input['app_link_title'] ); $input['app_link_url'] = wp_filter_nohtml_kses( $input['app_link_url'] ); $input['contact_no_with_menu'] = wp_filter_nohtml_kses( $input['contact_no_with_menu'] ); $input['twitter'] = wp_filter_nohtml_kses( $input['twitter'] ); $input['facebook'] = wp_filter_nohtml_kses( $input['facebook'] ); $input['flicker'] = wp_filter_nohtml_kses( $input['flicker'] ); $input['rssfeed'] = wp_filter_nohtml_kses( $input['rssfeed'] ); $input['color_picker_color1'] = wp_filter_nohtml_kses( $input['color_picker_color1'] ); $input['color_picker_color2'] = wp_filter_nohtml_kses( $input['color_picker_color2'] ); $input['color_picker_color3'] = wp_filter_nohtml_kses( $input['color_picker_color3'] ); $input['color_picker_color4'] = wp_filter_nohtml_kses( $input['color_picker_color4'] ); $input['color_picker_color5'] = wp_filter_nohtml_kses( $input['color_picker_color5'] ); $input['navigation'] = wp_filter_nohtml_kses( $input['navigation'] ); $input['archive'] = wp_filter_nohtml_kses( $input['archive'] ); $input['templ_listing_view_prof'] = wp_filter_nohtml_kses( $input['templ_listing_view_prof'] ); $input['allow_comments'] = wp_filter_nohtml_kses( $input['allow_comments'] ); } /** * GET RELATED POSTS BOF * * * @param unknown $postdata * @param unknown $my_post_type * @param unknown $post_tags * @param unknown $post_category * @param unknown $roomno (optional) * @param unknown $fees (optional) * @param unknown $time (optional) */ function get_related_posts($postdata, $my_post_type, $post_tags, $post_category, $roomno='', $fees='', $time='') { global $wp_query; $do_not_duplicate[] = $postdata->ID; if (strtolower(get_option('ptthemes_related_listing_per')) == strtolower('Tags')) { $terms = wp_get_post_terms($postdata->ID, $post_tags, array("fields" => "names")); $post_category = $post_tags; }else { $terms = wp_get_post_terms($postdata->ID, $post_category, array("fields" => "names")); } if (is_array($terms[0])) { $terms = implode(',', $terms[0]); }else { $terms = $terms[0]; } $relatedprd_count = 0; if (!empty($terms)) { $postQuery = array( 'post_type' => $my_post_type, 'post_status' => 'published', $post_category => $terms, 'posts_per_page' => 10, 'orderby' => 'date', 'order' => 'ASC', 'post__not_in' => array($postdata->ID), ); //query_posts($postQuery ); $my_query = new wp_query($postQuery); if ( $my_query->have_posts() ) { /**/ while ( $my_query->have_posts() ) : $my_query->the_post(); $do_not_duplicate[] = $postdata->ID; $comment_count = $post->comment_count; $post = $my_query->post; if ($relatedprd_count%2==0) { $class_name = 'course_detail_content'; }else { $class_name = 'course_detail_content alt'; } $course_postid = $my_query->post->ID; ?>
prefix.'templatic_custom_post_fields'; $sql = ''; if ($fields_name) { $fields_name = '"'.str_replace(',', '","', $fields_name).'"'; $sql .= " and htmlvar_name in (%s) "; } $sql .= " order by sort_order asc,admin_title asc"; $post_meta_info = $wpdb->get_results($wpdb->prepare("select * from $custom_fields_table where post_type = %s and is_active=%d and show_on_listing= %d $sql", $post_type, 1, 1, $fields_name)); $return_str = ''; $search_arr = array('{#TITLE#}', '{#VALUE#}'); $replace_arr = array(); if ($post_meta_info) { foreach ($post_meta_info as $post_meta_info_obj) { if ($post_meta_info_obj->site_title) { $replace_arr[] = $post_meta_info_obj->site_title; //print_r($replace_arr); } if ($post_meta_info_obj->ctype!='upload') { $sitetitle = $post_meta_info_obj->site_title; $replace_arr = array($sitetitle); $replace_arr = array("", get_post_meta($pid, $post_meta_info_obj->htmlvar_name, true)); if (get_post_meta($pid, $post_meta_info_obj->htmlvar_name, true) !="") { $return_str .= "".str_replace($search_arr, $replace_arr, $paten_str).""; } } } } return $return_str; } /** GET CUSTOM FIELDS EOF **/ /** * GET CUSTOM FIELDS BOF * * * @param unknown $pid * @param unknown $paten_str * @param unknown $fields_name (optional) * @param unknown $post_type * @return unknown */ function get_post_custom_for_detail_page($pid, $paten_str, $fields_name='', $post_type) { global $wpdb, $custom_fields_table; $custom_fields_table = $wpdb->prefix.'templatic_custom_post_fields'; $sql = ""; if ($fields_name) { $fields_name = '"'.str_replace(',', '","', $fields_name).'"'; $sql .= " and htmlvar_name in (%s) "; } $sql .= " order by sort_order asc,admin_title asc"; //echo $sql; $post_meta_info = $wpdb->get_results($wpdb->prepare("select * from $custom_fields_table where post_type = %s and is_active=%d and show_on_detail=%s $sql ", $post_type, 1, 1, $fields_name)); $return_str = ''; $search_arr = array('{#TITLE#}', '{#VALUE#}'); $replace_arr = array(); if ($post_meta_info) { foreach ($post_meta_info as $post_meta_info_obj) { if ($post_meta_info_obj->site_title) { $replace_arr[] = $post_meta_info_obj->site_title; //print_r($replace_arr); } if ($post_meta_info_obj->ctype!='upload') { $sitetitle = $post_meta_info_obj->site_title; $replace_arr = array($sitetitle); $replace_arr = array("".$sitetitle."", get_post_meta($pid, $post_meta_info_obj->htmlvar_name, true)); if (get_post_meta($pid, $post_meta_info_obj->htmlvar_name, true) !="") { $return_str .= "
".str_replace($search_arr, $replace_arr, $paten_str)."
"; } } } } return $return_str; } /** GET CUSTOM FIELDS EOF **/ /**-- get post tags BOF --**/ /** * * @param unknown $pid * @return unknown */ function templ_get_post_tags($pid) { $tags = wp_get_post_tags($pid); $tags1=''; for ($t = 0 ; $t < count($tags) ; $t++) { if ($t == count($tags)-1) { $sep=''; }else { $sep=', '; } $tags2 = "
".$tags[$t]->name."".$sep; $tags1 .= $tags2; } if (@$tags1) { return "Tags :  ".$tags1; } } /**-- get post tags BOF --**/ /** * */ function Educationremove_register_sidebar() { unregister_sidebar('subsidiary'); unregister_sidebar('subsidiary-2c'); unregister_sidebar('subsidiary-3c'); unregister_sidebar('subsidiary-4c'); unregister_sidebar('subsidiary-5c'); unregister_sidebar('after-header'); unregister_sidebar('after-header-2c'); unregister_sidebar('after-header-3c'); unregister_sidebar('after-header-4c'); unregister_sidebar('after-header-5c'); unregister_sidebar('widgets-template'); } /** * */ function single_title() { if ( !is_single() || !is_singular()) { add_filter('the_title', 'function_short_title'); } } /** * * @param unknown $title * @return unknown */ function function_short_title($title) { if ( !is_single() || !is_singular()) { if (hybrid_get_setting('templ_listing_view') == "grid") { return substr($title, 0, 20); }else { return $title; } }else { return $title; } } /***-- Short codes BOF ---***/ /** * Shortcodes - Messages ---// * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function message_download( $atts, $content = null ) { return '

' . $content . '

'; } add_shortcode( 'Download', 'message_download' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function message_alert( $atts, $content = null ) { return '

' . $content . '

'; } add_shortcode( 'Alert', 'message_alert' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function message_note( $atts, $content = null ) { return '

' . $content . '

'; } add_shortcode( 'Note', 'message_note' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function message_info( $atts, $content = null ) { return '

' . $content . '

'; } add_shortcode( 'Info', 'message_info' ); // Shortcodes - About Author -------------------------------------------------------- // /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function about_author( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'AuthorInfo', 'about_author' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function icon_list_view( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'IconList', 'icon_list_view' ); // Shortcodes - Boxes -------------------------------------------------------- // /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function normal_box( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'Normal_Box', 'normal_box' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function warning_box( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'Warning_Box', 'warning_box' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function about_box( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'About_Box', 'about_box' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function download_box( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'Download_Box', 'download_box' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function info_box( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'Info_Box', 'info_box' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function alert_box( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'Alert_Box', 'alert_box' ); // Shortcodes - Boxes - Equal -------------------------------------------------------- // /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function normal_box_equal( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'Normal_Box_Equal', 'normal_box_equal' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function warning_box_equal( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'Warning_Box_Equal', 'warning_box_equal' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function about_box_equal( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'About_Box_Equal', 'about_box_equal' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function download_box_equal( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'Download_Box_Equal', 'download_box_equal' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function info_box_equal( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'Info_Box_Equal', 'info_box_equal' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function alert_box_equal( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'Alert_Box_Equal', 'alert_box_equal' ); // Shortcodes - Content Columns -------------------------------------------------------- // /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function one_half_column( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'One_Half', 'one_half_column' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function one_half_last( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'One_Half_Last', 'one_half_last' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function one_third_column( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'One_Third', 'one_third_column' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function one_third_column_last( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'One_Third_Last', 'one_third_column_last' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function one_fourth_column( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'One_Fourth', 'one_fourth_column' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function one_fourth_column_last( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'One_Fourth_Last', 'one_fourth_column_last' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function two_thirds( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'Two_Third', 'two_thirds' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function two_thirds_last( $atts, $content = null ) { return '
' . $content . '

'; } add_shortcode( 'Two_Third_Last', 'two_thirds_last' ); /** * * @param unknown $atts * @param unknown $content (optional) * @return unknown */ function dropcaps( $atts, $content = null ) { return '

' . $content . '

'; } add_shortcode( 'Dropcaps', 'dropcaps' ); // Shortcodes - Small Buttons -------------------------------------------------------- // /** * * @param unknown $atts * @param unknown $content * @return unknown */ function small_button( $atts, $content ) { return '
' . $content . '
'; } add_shortcode( 'Small_Button', 'small_button' ); /***-- Short codes EOF ---***/ /** * Function to get facilities BOF * * * @param unknown $post_id */ function templa_get_designation($post_id) { $post_categories = wp_get_tax_categories($post_id, '', 'designations'); $taxonomy = 'designations'; $taxonomy_category=''; foreach ($post_categories as $c) { $cat = get_term( $c, $taxonomy ); $cats[] = array( 'name' => $cat->name, 'slug' => $cat->slug ); } for ($t = 0 ; $t < count($cats) ; $t++) { if ($t == count($cats)-1) { $sep=''; }else { $sep=', '; } $cats2 = "".$cats[$t]['name']."".$sep; $taxonomy_category .= $cats2; } if ((@$post_type == 'gallery' && @$_REQUEST['gallery'] != "")) { $taxonomy_category = ucwords(@$_REQUEST['gallery']); } if ((@$post_type == 'staff' && @$_REQUEST['staff'] != "")) { $taxonomy_category = ucwords(@$_REQUEST['staff']); } if ( @$_REQUEST['attachment_id'] != '' ) { $taxonomy_category = _e(ucwords('gallery'), 'templatic'); } if (@$taxonomy_category != '') { echo $taxonomy_category; } } /** Function to get facilities EOF **/ /* Function to add theme color settings options in wordpress customizer START */ /** * * @param unknown $wp_customize */ function education_register_customizer_settings($wp_customize) { $wp_customize->add_section('education_theme_settings', array( 'title' => 'Education Theme Settings', 'priority'=>'39' )); $wp_customize->add_section('education_footer_navigation_settings', array( 'title' => 'Education Footer Navigation Settings', 'priority'=>'40' )); $wp_customize->add_section('education_header_navigation_settings', array( 'title' => 'Education Header Search Settings', 'priority'=>'41' )); $wp_customize->add_section('education_social_media_settings', array( 'title' => 'Social Media Settings For Course Detail Page', 'priority'=>'43' )); /* Add Settings START */ $wp_customize->add_setting('supreme_theme_settings[app_link]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_app_link", 'sanitize_js_callback' => "education_customize_supreme_app_link" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[app_link_title]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_app_link_title", 'sanitize_js_callback' => "education_customize_supreme_app_link_title" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[app_link_url]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_app_link_url", 'sanitize_js_callback' => "education_customize_supreme_app_link_url" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[templ_listing_view]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_templ_listing_view", 'sanitize_js_callback' => "education_customize_supreme_templ_listing_view" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[templ_listing_view_prof]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_templ_listing_view_prof", 'sanitize_js_callback' => "education_customize_supreme_templ_listing_view_prof" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[allow_comments]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_allow_comments", 'sanitize_js_callback' => "education_customize_supreme_allow_comments" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[contact_no_with_menu]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_contact_no_with_menu", 'sanitize_js_callback' => "education_customize_supreme_contact_no_with_menu" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[twitter]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_twitter", 'sanitize_js_callback' => "education_customize_supreme_twitter" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[facebook]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_facebook", 'sanitize_js_callback' => "education_customize_supreme_facebook" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[flicker]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_flicker", 'sanitize_js_callback' => "education_customize_supreme_flicker" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[rssfeed]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_rssfeed", 'sanitize_js_callback' => "education_customize_supreme_rssfeed" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[navigation]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_navigation", 'sanitize_js_callback' => "education_customize_supreme_navigation" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[color_picker_color1]', array( 'default' => '', 'type' => 'option', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_color1", 'sanitize_js_callback' => "education_customize_supreme_color1", //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[color_picker_color2]', array( 'default' => '', 'type' => 'option', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_color2", 'sanitize_js_callback' => "education_customize_supreme_color2", //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[color_picker_color3]', array( 'default' => '', 'type' => 'option', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_color3", 'sanitize_js_callback' => "education_customize_supreme_color3", //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[color_picker_color4]', array( 'default' => '', 'type' => 'option', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_color4", 'sanitize_js_callback' => "education_customize_supreme_color4", //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[color_picker_color5]', array( 'default' => '', 'type' => 'option', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_color5", 'sanitize_js_callback' => "education_customize_supreme_color5", //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[color_picker_color6]', array( 'default' => '', 'type' => 'option', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_color6", 'sanitize_js_callback' => "education_customize_supreme_color6", //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[ptthemes_twitter]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_ptthemes_twitter", 'sanitize_js_callback' => "education_customize_supreme_ptthemes_twitter" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[ptthemes_facebook]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_ptthemes_facebook", 'sanitize_js_callback' => "education_customize_supreme_ptthemes_facebook" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[ptthemes_digg]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_ptthemes_digg", 'sanitize_js_callback' => "education_customize_supreme_ptthemes_digg" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[ptthemes_del]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_ptthemes_del", 'sanitize_js_callback' => "education_customize_supreme_ptthemes_del" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[ptthemes_reddit]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_ptthemes_reddit", 'sanitize_js_callback' => "education_customize_supreme_ptthemes_reddit" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[ptthemes_linkedin]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_ptthemes_linkedin", 'sanitize_js_callback' => "education_customize_supreme_ptthemes_linkedin" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[ptthemes_technorati]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_ptthemes_technorati", 'sanitize_js_callback' => "education_customize_supreme_ptthemes_technorati" //'transport' => 'postMessage', )); $wp_customize->add_setting('supreme_theme_settings[ptthemes_myspace]', array( 'default' => '', 'capabilities' => 'edit_theme_options', 'sanitize_callback' => "education_customize_supreme_ptthemes_myspace", 'sanitize_js_callback' => "education_customize_supreme_ptthemes_myspace" //'transport' => 'postMessage', )); /* Add Control START */ /* Primary: Effect on buttons, links and main headings. Secondary: Effect on sub-headings. Content: Effect on content. Sub-text: Effect on sub-texts. Background: Effect on body & menu background. */ $wp_customize->remove_control('supreme_author_bio_pages'); $wp_customize->add_control( 'app_link', array( 'label' => __( 'Application ID', T_DOMAIN), 'section' => 'education_theme_settings', 'settings' => 'supreme_theme_settings[app_link]', 'type' => 'checkbox' ) ) ; $wp_customize->add_control( 'app_link_title', array( 'label' => __( 'Application Link Title', T_DOMAIN), 'section' => 'education_theme_settings', 'settings' => 'supreme_theme_settings[app_link_title]', 'type' => 'text' ) ) ; $wp_customize->add_control( 'app_link_url', array( 'label' => __( 'Application Link URL', T_DOMAIN), 'section' => 'education_theme_settings', 'settings' => 'supreme_theme_settings[app_link_url]', 'type' => 'text' ) ) ; $wp_customize->add_control( 'templ_listing_view', array( 'label' => __( 'Select Display view (except staff listing page)', T_DOMAIN), 'section' => 'education_theme_settings', 'settings' => 'supreme_theme_settings[templ_listing_view]', 'type' => 'select', 'choices' => array( 'list' => 'List View', 'grid' => 'Grid View' ), ) ) ; $wp_customize->add_control( 'templ_listing_view_prof', array( 'label' => __( 'Select Display view (only on staff listing page)', T_DOMAIN), 'section' => 'education_theme_settings', 'settings' => 'supreme_theme_settings[templ_listing_view_prof]', 'type' => 'select', 'choices' => array( 'list' => 'List View', 'grid' => 'Grid View' ) ) ) ; $wp_customize->add_control( 'allow_comments', array( 'label' => __( 'Comments on Taxonomy pages?', T_DOMAIN), 'section' => 'education_theme_settings', 'settings' => 'supreme_theme_settings[allow_comments]', 'type' => 'checkbox' ) ) ; $wp_customize->add_control( 'contact_no_with_menu', array( 'label' => __( 'Contact no on header', T_DOMAIN), 'section' => 'education_theme_settings', 'settings' => 'supreme_theme_settings[contact_no_with_menu]', 'type' => 'text' ) ) ; $wp_customize->add_control( 'twitter', array( 'label' => __( 'Twitter Full URL', T_DOMAIN), 'section' => 'education_footer_navigation_settings', 'settings' => 'supreme_theme_settings[twitter]', 'type' => 'text' ) ) ; $wp_customize->add_control( 'facebook', array( 'label' => __( 'Facebook Full URL', T_DOMAIN), 'section' => 'education_footer_navigation_settings', 'settings' => 'supreme_theme_settings[facebook]', 'type' => 'text' ) ) ; $wp_customize->add_control( 'flicker', array( 'label' => __( 'Flicker Full URL', T_DOMAIN), 'section' => 'education_footer_navigation_settings', 'settings' => 'supreme_theme_settings[flicker]', 'type' => 'text' ) ) ; $wp_customize->add_control( 'rssfeed', array( 'label' => __( 'Rss Full URL', T_DOMAIN), 'section' => 'education_footer_navigation_settings', 'settings' => 'supreme_theme_settings[rssfeed]', 'type' => 'text' ) ) ; $wp_customize->add_control( 'navigation', array( 'label' => __( 'Hide Header Search', T_DOMAIN), 'section' => 'education_header_navigation_settings', 'settings' => 'supreme_theme_settings[navigation]', 'type' => 'checkbox' ) ) ; $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'color_picker_color1', array( 'label' => __( 'Change color of Links, Buttons Gradient, Search bar left', T_DOMAIN), 'section' => 'colors', 'settings' => 'supreme_theme_settings[color_picker_color1]', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'color_picker_color2', array( 'label' => __( 'Change color of inputs, Buttons Gradient, Search bar right', T_DOMAIN ), 'section' => 'colors', 'settings' => 'supreme_theme_settings[color_picker_color2]', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'color_picker_color3', array( 'label' => __( 'Change color of Links hover, headings, titles, footer bottom', T_DOMAIN ), 'section' => 'colors', 'settings' => 'supreme_theme_settings[color_picker_color3]', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'color_picker_color4', array( 'label' => __( 'Change color of Sub-text', T_DOMAIN ), 'section' => 'colors', 'settings' => 'supreme_theme_settings[color_picker_color4]', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'color_picker_color5', array( 'label' => __( 'Change color of Header, Footer', T_DOMAIN ), 'section' => 'colors', 'settings' => 'supreme_theme_settings[color_picker_color5]', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'color_picker_color6', array( 'label' => __( 'Change color of Body Background', T_DOMAIN ), 'section' => 'colors', 'settings' => 'supreme_theme_settings[color_picker_color6]', ) ) ); $wp_customize->remove_control('background_color'); $wp_customize->add_control( 'archive', array( 'label' => __( 'Select Post Type', T_DOMAIN), 'section' => 'education_archive_page_settings', 'settings' => 'supreme_theme_settings[archive]', 'type' => 'select', 'choices' => array( 'facilities' => 'facilities', 'gallery' => 'gallery', 'course'=>'course', 'staff'=>'staff' ), ) ) ; $wp_customize->add_control( 'ptthemes_twitter', array( 'label' => __( 'Twitter', T_DOMAIN), 'section' => 'education_social_media_settings', 'settings' => 'supreme_theme_settings[ptthemes_twitter]', 'type' => 'checkbox' ) ) ; $wp_customize->add_control( 'ptthemes_facebook', array( 'label' => __( 'Facebook', T_DOMAIN), 'section' => 'education_social_media_settings', 'settings' => 'supreme_theme_settings[ptthemes_facebook]', 'type' => 'checkbox' ) ) ; $wp_customize->add_control( 'ptthemes_digg', array( 'label' => __( 'Digg it', T_DOMAIN), 'section' => 'education_social_media_settings', 'settings' => 'supreme_theme_settings[ptthemes_digg]', 'type' => 'checkbox' ) ) ; $wp_customize->add_control( 'ptthemes_del', array( 'label' => __( 'Add to Delicious', T_DOMAIN), 'section' => 'education_social_media_settings', 'settings' => 'supreme_theme_settings[ptthemes_del]', 'type' => 'checkbox' ) ) ; $wp_customize->add_control( 'ptthemes_reddit', array( 'label' => __( 'Add to Read it', T_DOMAIN), 'section' => 'education_social_media_settings', 'settings' => 'supreme_theme_settings[ptthemes_reddit]', 'type' => 'checkbox' ) ) ; $wp_customize->add_control( 'ptthemes_linkedin', array( 'label' => __( 'Add to Linked In', T_DOMAIN), 'section' => 'education_social_media_settings', 'settings' => 'supreme_theme_settings[ptthemes_linkedin]', 'type' => 'checkbox' ) ) ; $wp_customize->add_control( 'ptthemes_technorati', array( 'label' => __( 'Add to Technorati', T_DOMAIN), 'section' => 'education_social_media_settings', 'settings' => 'supreme_theme_settings[ptthemes_technorati]', 'type' => 'checkbox' ) ) ; $wp_customize->add_control( 'ptthemes_myspace', array( 'label' => __( 'Add to MySpace', T_DOMAIN), 'section' => 'education_social_media_settings', 'settings' => 'supreme_theme_settings[ptthemes_myspace]', 'type' => 'checkbox' ) ) ; } /* Handles changing settings for the live preview of the theme START. */ /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_app_link( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[app_link]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_app_link", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_app_link_title( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[app_link_title]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_app_link_title", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_app_link_url( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[app_link_url]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_app_link_url", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_templ_listing_view( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[templ_listing_view]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_templ_listing_view", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_templ_listing_view_prof( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[templ_listing_view_prof]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_templ_listing_view_prof", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_allow_comments( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[allow_comments]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_allow_comments", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_contact_no_with_menu( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[contact_no_with_menu]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_contact_no_with_menu", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_twitter( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[twitter]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_twitter", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_facebook( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[facebook]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_facebook", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_flicker( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[flicker]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_flicker", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_rssfeed( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[rssfeed]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_rssfeed", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_navigation( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[navigation]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_navigation", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_color1( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[color_picker_color1]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_color1", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_color2( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[color_picker_color2]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_color2", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_color3( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[color_picker_color3]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_color3", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_color4( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[color_picker_color4]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_color4", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_color5( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[color_picker_color5]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_color5", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_color6( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[color_picker_color6]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_color6", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_ptthemes_twitter( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[ptthemes_twitter]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_ptthemes_twitter", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_ptthemes_facebook( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[ptthemes_facebook]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_ptthemes_facebook", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_ptthemes_digg( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[ptthemes_digg]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_ptthemes_digg", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_ptthemes_del( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[ptthemes_del]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_ptthemes_del", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_ptthemes_reddit( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[ptthemes_reddit]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_ptthemes_reddit", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_ptthemes_linkedin( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[ptthemes_linkedin]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_ptthemes_linkedin", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_ptthemes_technorati( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[ptthemes_technorati]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_ptthemes_technorati", $setting, $object ); } /** * * @param unknown $setting * @param unknown $object * @return unknown */ function education_customize_supreme_ptthemes_myspace( $setting, $object ) { /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "supreme_theme_settings[ptthemes_myspace]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "education_customize_supreme_ptthemes_myspace", $setting, $object ); } /* Function to add theme color settings options in wordpress customizer END */ /* THEME UPDATE CODING START */ /** * Theme update templatic menu */ function EducationAcademy_tmpl_theme_update() { require_once get_stylesheet_directory()."/templatic_login.php"; } /* Theme update templatic menu*/ /** * */ function EducationAcademy_tmpl_support_theme() { echo "

Need Help?

"; echo "

Here's how you can get help from templatic on any thing you need with regarding this theme.

"; echo "
"; echo '

'."Take a look at theme guide".'

'; echo '

'."Knowlegebase".'

'; echo '

'."Explore our community forums".'

'; echo '

'."Create a support ticket in Helpdesk".'

'; } /* Theme update templatic menu*/ /** * */ function EducationAcademy_tmpl_purchase_theme() { wp_redirect( 'http://templatic.com/wordpress-themes-store/' ); exit; } add_action('admin_menu', 'EducationAcademy_theme_menu', 11); // add submenu page add_action('admin_menu', 'delete_EducationAcademy_templatic_menu', 11); /** * */ function EducationAcademy_theme_menu() { add_submenu_page( 'templatic_menu', 'Theme Update', 'Theme Update', 'administrator', 'EducationAcademy_tmpl_theme_update', 'EducationAcademy_tmpl_theme_update', 27 ); add_submenu_page( 'templatic_menu', 'Framework Update', 'Framework Update', 'administrator', 'tmpl_framework_update', 'tmpl_framework_update', 28 ); add_submenu_page( 'templatic_menu', 'Get Support' , 'Get Support' , 'administrator', 'EducationAcademy_tmpl_support_theme', 'EducationAcademy_tmpl_support_theme', 29 ); add_submenu_page( 'templatic_menu', 'Purchase theme', 'Purchase theme', 'administrator', 'EducationAcademy_tmpl_purchase_theme', 'EducationAcademy_tmpl_purchase_theme', 30 ); } /* Realtr delete menu */ /** * */ function delete_EducationAcademy_templatic_menu() { remove_submenu_page('templatic_menu', 'templatic_menu'); } /* THEME UPDATE CODING END */ ?>