= 2 || $page >= 2 ) { $title = "$title $sep " . sprintf( __( 'Page %s', 'bonestheme' ), max( $paged, $page ) ); } return $title; } add_filter( 'wp_title', 'bones_filter_title', 10, 2 ); /************* THUMBNAIL SIZE OPTIONS *************/ // Thumbnail sizes add_image_size( 'eo-featurette', 350, 290, true ); add_image_size( 'eo-highlight', 140, 140, true); add_image_size( 'eo-carousel', 970, 360, true); /************* ACTIVE SIDEBARS ********************/ // Sidebars & Widgetizes Areas function bones_register_sidebars() { register_sidebar(array( 'id' => 'sidebar1', 'name' => 'Main Sidebar', 'description' => 'Used on every page.', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'footer1', 'name' => 'Footer 1', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'footer2', 'name' => 'Footer 2', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'footer3', 'name' => 'Footer 3', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); /* to add more sidebars or widgetized areas, just copy and edit the above sidebar code. In order to call your new sidebar just use the following code: Just change the name to whatever your new sidebar's id is, for example: To call the sidebar in your template, you can just copy the sidebar.php file and rename it to your sidebar's name. So using the above example, it would be: sidebar-sidebar2.php */ } // don't remove this bracket! /************* COMMENT LAYOUT *********************/ // Comment Layout function bones_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • >
    %s', get_comment_author_link()) ?> ','') ?> comment_approved == '0') : ?>

    Login'; $args["reply_text"] = ' Reply'; $args["before"] = '
    '; $args["after"] = '
    '; ?> $depth, 'max_depth' => $args['max_depth']))) ?>
  •  
    '; return $form; } // don't remove this bracket! /****************** password protected post form *****/ add_filter( 'the_password_form', 'custom_password_form' ); function custom_password_form() { global $post; $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); $o = '
    ' . '

    ' . __( "This post is password protected. To view it please enter your password below:" ,'bonestheme') . '

    ' . '
    '; return $o; } /*********** update standard wp tag cloud widget so it looks better ************/ add_filter( 'widget_tag_cloud_args', 'my_widget_tag_cloud_args' ); function my_widget_tag_cloud_args( $args ) { $args['number'] = 20; // show less tags $args['largest'] = 9.75; // make largest and smallest the same - i don't like the varying font-size look $args['smallest'] = 9.75; $args['unit'] = 'px'; return $args; } // filter tag cloud output so that it can be styled by CSS function add_tag_class( $taglinks ) { $tags = explode('', $taglinks); $regex = "#(.*tag-link[-])(.*)(' title.*)#e"; $term_slug = "(get_tag($2) ? get_tag($2)->slug : get_category($2)->slug)"; foreach( $tags as $tag ) { $tagn[] = preg_replace($regex, "('$1$2 label tag-'.$term_slug.'$3')", $tag ); } $taglinks = implode('', $tagn); return $taglinks; } add_action( 'wp_tag_cloud', 'add_tag_class' ); add_filter( 'wp_tag_cloud','wp_tag_cloud_filter', 10, 2) ; function wp_tag_cloud_filter( $return, $args ) { return '
    ' . $return . '
    '; } // Enable shortcodes in widgets add_filter( 'widget_text', 'do_shortcode' ); // Disable jump in 'read more' link function remove_more_jump_link( $link ) { $offset = strpos($link, '#more-'); if ( $offset ) { $end = strpos( $link, '"',$offset ); } if ( $end ) { $link = substr_replace( $link, '', $offset, $end-$offset ); } return $link; } add_filter( 'the_content_more_link', 'remove_more_jump_link' ); // Remove height/width attributes on images so they can be responsive add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 ); add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 ); function remove_thumbnail_dimensions( $html ) { $html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html ); return $html; } // Add the Meta Box to the homepage template function add_homepage_meta_box() { global $post; // Only add homepage meta box if template being used is the homepage template // $post_id = isset($_GET['post']) ? $_GET['post'] : (isset($_POST['post_ID']) ? $_POST['post_ID'] : ""); $post_id = $post->ID; $template_file = get_post_meta($post_id,'_wp_page_template',TRUE); if ( $template_file == 'page-homepage.php' ){ add_meta_box( 'homepage_meta_box', // $id 'Optional Homepage Tagline', // $title 'show_homepage_meta_box', // $callback 'page', // $page 'normal', // $context 'high'); // $priority } } add_action( 'add_meta_boxes', 'add_homepage_meta_box' ); // Field Array $prefix = 'custom_'; $custom_meta_fields = array( array( 'label'=> 'Homepage tagline area', 'desc' => 'Displayed underneath page title. Only used on homepage template. HTML can be used.', 'id' => $prefix.'tagline', 'type' => 'textarea' ) ); // The Homepage Meta Box Callback function show_homepage_meta_box() { global $custom_meta_fields, $post; // Use nonce for verification wp_nonce_field( basename( __FILE__ ), 'wpbs_nonce' ); // Begin the field table and loop echo ''; foreach ( $custom_meta_fields as $field ) { // get value of this field if it exists for this post $meta = get_post_meta($post->ID, $field['id'], true); // begin a table row with echo ' aaa '; } // end foreach echo '
    '; switch($field['type']) { // text case 'text': echo '
    '.$field['desc'].''; break; // textarea case 'textarea': echo '
    '.$field['desc'].''; break; } //end switch echo '
    '; // end table } // Save the Data function save_homepage_meta( $post_id ) { global $custom_meta_fields; // verify nonce if ( !isset( $_POST['wpbs_nonce'] ) || !wp_verify_nonce($_POST['wpbs_nonce'], basename(__FILE__)) ) return $post_id; // check autosave if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id; // check permissions if ( 'page' == $_POST['post_type'] ) { if ( !current_user_can( 'edit_page', $post_id ) ) return $post_id; } elseif ( !current_user_can( 'edit_post', $post_id ) ) { return $post_id; } // loop through fields and save the data foreach ( $custom_meta_fields as $field ) { $old = get_post_meta( $post_id, $field['id'], true ); $new = $_POST[$field['id']]; if ($new && $new != $old) { update_post_meta( $post_id, $field['id'], $new ); } elseif ( '' == $new && $old ) { delete_post_meta( $post_id, $field['id'], $old ); } } // end foreach } add_action( 'save_post', 'save_homepage_meta' ); // Add thumbnail class to thumbnail links function add_class_attachment_link( $html ) { $postid = get_the_ID(); $html = str_replace( ']+)?>/', '', $content, 1); } add_filter( 'the_content', 'first_paragraph' ); add_editor_style('editor-style.css'); // Add Twitter Bootstrap's standard 'active' class name to the active nav link item add_filter('nav_menu_css_class', 'add_active_class', 10, 2 ); function add_active_class($classes, $item) { if( $item->menu_item_parent == 0 && in_array('current-menu-item', $classes) ) { $classes[] = "active"; } return $classes; } // enqueue styles function eo_theme_head() { global $eo_options; if( of_get_option( 'use_less') === "1" ) { // Have resources can be loaded less but chose regular css way // Less sources $less_rsrcs = of_get_option( 'use_less_for'); if( !empty($less_rsrcs) & is_array($less_rsrcs) ) { $less_rsrcs_arr = array(); foreach ( $less_rsrcs as $less_rsrc => $v) { if($v == "1") $less_rsrcs_arr[] = $less_rsrc; } //var_dump($less_rsrcs_arr); } if(in_array("bootstrap",$less_rsrcs_arr) ) echo ''; if(in_array("fontawesome",$less_rsrcs_arr) ) echo ''; /* array (size=4) 'bootstrap' => string '1' (length=1) 'fontawesome' => string '1' (length=1) 'example' => string '0' (length=1) 'some_other' => string '0' (length=1)*/ wp_register_script( 'less_js', get_template_directory_uri() . '/lib/js/less.min.js', array(), '1.5.0', false ); wp_enqueue_script('less_js'); } else { //var_dump(of_get_option( 'load_bs_fe') ); // if( of_get_option( 'load_bs_fe') == "1" ) { ( of_get_option('use_bs_min_fe') == "1" ) ? $min = ".min" : $min = '' ; wp_register_style( 'bootstrap', get_template_directory_uri() . '/lib/bootstrap/css/bootstrap'.$min.'.css', array(), '3.0.1', 'all' ); wp_enqueue_style( 'bootstrap' ); // } } $use_bsw_theme = of_get_option( 'use_bsw_themes' ); $bsw_theme = of_get_option( 'bsw_theme' ); if( of_get_option( 'use_fontawesome') == "1" ) { // ( of_get_option('use_bs_min_css') == "1") ? $min = ".min" : $min = '' ; wp_register_style( 'fontawesome', get_template_directory_uri() . '/lib/font-awesome/css/font-awesome.min.css', array(), '1.0', 'all' ); wp_enqueue_style( 'fontawesome' ); } if( of_get_option( 'use_lightbox') == "1" ) { //( of_get_option('use_bs_min_css') == "1") ? $min = ".min" : $min = '' ; wp_register_style( 'colorbox', get_template_directory_uri() . '/lib/colorbox/colorbox.css', array(), '1.0', 'all' ); wp_enqueue_style( 'colorbox' ); } wp_register_style( 'bootstrap-ultimate', get_stylesheet_uri(), array(), '1.0', 'all' ); wp_enqueue_style( 'bootstrap-ultimate'); if( $use_bsw_theme ) { wp_register_style( 'bsw_theme', get_template_directory_uri() . '/panel/of/themes/' . $bsw_theme . '.css', array("bootstrap"), '1.0', 'all' ); wp_enqueue_style( 'bsw_theme' ); // Glyphicons get lost when using Bootswatch theme, you need to redefine them, not sure which is better for this fix: another http request or a few lines of ugly inline '; } function eo_inline_js_per_post(){ global $post; $post_inline_js = get_post_meta($post->ID,'_eo_cust_post_js',true); if ( $post_inline_js && is_singular() ) { echo ''; } } add_action('wp_footer','eo_inline_js_per_post'); // Get theme options function inline_css_fe(){ global $eo_options; $gl_u = get_template_directory_uri().'/lib/bootstrap/fonts/'; $theme_options_styles = ''; if ( $eo_options["sticky_footer"] == "1") { $theme_options_styles .= 'html,body { height: 100%;} #wrap.stickyf { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -60px; padding: 0 0 60px;} #footer { height: 60px; background-color: #f5f5f5;}'; } if(of_get_option('show_slider') == "1") $theme_options_styles .= '.navbar {margin-bottom: 0}'; if(of_get_option('use_bsw_themes') == "1") { /* bsw missing glyphicon fix */ $theme_options_styles .= '@font-face { font-family: "Glyphicons Halflings"; src: url("'.$gl_u.'glyphicons-halflings-regular.eot"); src: url("'.$gl_u.'glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"), url("'.$gl_u.'glyphicons-halflings-regular.woff") format("woff"), url("'.$gl_u.'glyphicons-halflings-regular.ttf") format("truetype"), url("'.$gl_u.'glyphicons-halflings-regular.svg#glyphicons-halflingsregular") format("svg"); }'; } if ( isset($eo_options['eo_typo_body']) ) { $typo_body = $eo_options['eo_typo_body']; $theme_options_styles .= ' body{ font-family: ' .str_replace("+"," ",$typo_body['face'] ). ';'; if ( $typo_body["source"] == "gwf_font" ) { $vrnt = $typo_body['variant']; ( preg_match('#[0-9]#',$vrnt) ) ? $fwe = preg_replace("/[^0-9]/", "",$vrnt) : $fwe = 'normal'; if ( strpos( $vrnt,"italic") !== false ) $theme_options_styles .= 'font-style: italic;'; $theme_options_styles .= 'font-weight: ' . $fwe. ';'; } if ( $typo_body["source"] == "os_font" ) $theme_options_styles .= 'font-weight: ' . $typo_body['style'] . ';'; if( ! empty($typo_body['color']) ) $theme_options_styles .= 'color: ' . $typo_body['color'] . ';'; if( ! empty($typo_body['size']) ) $theme_options_styles .= 'font-size: ' . $typo_body['size'] . ';'; $theme_options_styles .= '}'; } if ( isset($eo_options['eo_typo_heading']) ) { $typo_head = $eo_options['eo_typo_heading']; $theme_options_styles .= ' h1, h2, h3, h4, h5, h6{ font-family: ' . str_replace("+"," ",$typo_head['face'] ). ';'; if ( $typo_head["source"] == "gwf_font" ) { $vrnt = $typo_head['variant']; ( preg_match('#[0-9]#',$vrnt) ) ? $fwe = preg_replace("/[^0-9]/", "",$vrnt) : $fwe = 'normal'; if ( strpos( $vrnt,"italic") !== false ) $theme_options_styles .= 'font-style: italic;'; $theme_options_styles .= 'font-weight: ' . $fwe. ';'; } if ( $typo_head["source"] == "os_font" ) $theme_options_styles .= 'font-weight: ' . $typo_head['style'] . ';'; if( ! empty($typo_head['color']) ) $theme_options_styles .= 'color: ' . $typo_head['color'] . ';'; // if( ! empty($typo_head['size']) ) $theme_options_styles .= 'font-size: ' . $typo_head['size'] . ';'; $theme_options_styles .= '}'; } if ( isset($eo_options['eo_typo_nav']) ) { $typo_nav = $eo_options['eo_typo_nav']; $theme_options_styles .= ' .navbar, .navbar-default .navbar-nav > li > a, .navbar-inverse .navbar-nav > li > a, .dropdown-menu > li > a{ font-family: ' . str_replace("+"," ",$typo_nav['face'] ). ';'; if ( $typo_nav["source"] == "gwf_font" ) { $vrnt = $typo_nav['variant']; ( preg_match('#[0-9]#',$vrnt) ) ? $fwe = preg_replace("/[^0-9]/", "",$vrnt) : $fwe = 'normal'; if ( strpos( $vrnt,"italic") !== false ) $theme_options_styles .= 'font-style: italic;'; $theme_options_styles .= 'font-weight: ' . $fwe. ';'; } if ( $typo_nav["source"] == "os_font" ) $theme_options_styles .= 'font-weight: ' . $typo_nav['style'] . ';'; if( ! empty($typo_nav['color']) ) $theme_options_styles .= 'color: ' . $typo_nav['color'] . ';'; $theme_options_styles .= '}'; } // if ( $typo_body["source"] == "gwf_font" ) $theme_options_styles .= 'font-family: ' . $heading_typography['face'] . '; $link_color = of_get_option( 'link_color' ); if ($link_color) { $theme_options_styles .= ' a{ color: ' . $link_color . '; }'; } $link_hover_color = of_get_option( 'link_hover_color' ); if ($link_hover_color) { $theme_options_styles .= ' a:hover{ color: ' . $link_hover_color . '; }'; } $caru_of_prevent = of_get_option( 'caru_of_prevent' ); $caru_of_prevent_h = of_get_option( 'caru_of_prevent_h' ); if ($caru_of_prevent) { $theme_options_styles .= ' .carousel { overflow: hidden; max-height: ' . $caru_of_prevent_h . '; color: ' . $link_hover_color . '; }'; } $link_active_color = of_get_option( 'link_active_color' ); if ($link_active_color) { $theme_options_styles .= ' a:active{ color: ' . $link_active_color . '; }'; } $topbar_position = of_get_option( 'nav_position' ); if ($topbar_position == 'scroll') { $theme_options_styles .= ' .navbar{ position: static; } body{ padding-top: 0; } #content { padding-top: 27px; } ' ; } $topbar_bg_color = of_get_option( 'top_nav_bg_color' ); $use_gradient = of_get_option( 'showhidden_gradient' ); if ( $topbar_bg_color && !$use_gradient ) { $theme_options_styles .= ' .navbar-inner, .navbar .fill { background-color: '. $topbar_bg_color . '; background-image: none; }' . $topbar_bg_color; } if ( $use_gradient ) { $topbar_bottom_gradient_color = of_get_option( 'top_nav_bottom_gradient_color' ); $theme_options_styles .= ' .navbar-inner, .navbar .fill { background-image: -khtml-gradient(linear, left top, left bottom, from(' . $topbar_bg_color . '), to('. $topbar_bottom_gradient_color . ')); background-image: -moz-linear-gradient(top, ' . $topbar_bg_color . ', '. $topbar_bottom_gradient_color . '); background-image: -ms-linear-gradient(top, ' . $topbar_bg_color . ', '. $topbar_bottom_gradient_color . '); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, ' . $topbar_bg_color . '), color-stop(100%, '. $topbar_bottom_gradient_color . ')); background-image: -webkit-linear-gradient(top, ' . $topbar_bg_color . ', '. $topbar_bottom_gradient_color . '2); background-image: -o-linear-gradient(top, ' . $topbar_bg_color . ', '. $topbar_bottom_gradient_color . '); background-image: linear-gradient(top, ' . $topbar_bg_color . ', '. $topbar_bottom_gradient_color . '); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=\'' . $topbar_bg_color . '\', endColorstr=\''. $topbar_bottom_gradient_color . '2\', GradientType=0); }'; } else{ } $topbar_link_color = of_get_option( 'top_nav_link_color' ); if ( $topbar_link_color ) { $theme_options_styles .= ' .navbar .nav li a { color: '. $topbar_link_color . '; }'; } $topbar_link_hover_color = of_get_option( 'top_nav_link_hover_color' ); if ( $topbar_link_hover_color ) { $theme_options_styles .= ' .navbar .nav li a:hover { color: '. $topbar_link_hover_color . '; }'; } $topbar_dropdown_hover_bg_color = of_get_option( 'top_nav_dropdown_hover_bg' ); if ( $topbar_dropdown_hover_bg_color ) { $theme_options_styles .= ' .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover { background-color: ' . $topbar_dropdown_hover_bg_color . '; } '; } $topbar_dropdown_item_color = of_get_option( 'top_nav_dropdown_item' ); if ( $topbar_dropdown_item_color ){ $theme_options_styles .= ' .dropdown-menu a{ color: ' . $topbar_dropdown_item_color . ' !important; } '; } $jumbo_unit_bg_color = of_get_option( 'jumbo_bg_color' ); if ( $jumbo_unit_bg_color ) { $theme_options_styles .= ' .jumbotron { background-color: '. $jumbo_unit_bg_color . '; }'; } $suppress_comments_message = of_get_option( 'suppress_comments_message' ); if ( $suppress_comments_message ){ /* $theme_options_styles .= ' #main article { border-bottom: none; }'; _eo-check: what does this have to do with anything ?*/ } $additional_css = of_get_option( 'eo_custom_css' ); if( $additional_css ){ $theme_options_styles .= $additional_css; } if( $theme_options_styles ){ echo ''; } $is_bs_test = isset($_REQUEST['bstest']); } // end get_wpbs_theme_options function add_action('wp_footer', 'eo_front_js'); function eo_front_js() { ?> $gfw_family["family"], "variants" => $gfw_family["variants"], "lastMod" => $gfw_family["lastModified"], "subsets" => $gfw_family["subsets"] ); } $tfc = count($GWF_families); $google_font_src_arr = array( "font_src_slug" => "gwf_font", "font_src_name" => "Google Fonts", "font_faces" => $GWF_families ); $all_font_opt["gwf_font"] = $google_font_src_arr; // var_dump($google_font_src_arr); update_option( 'eo_googlefonts_arr', $google_font_src_arr ); update_option( 'eo_all_fonts_arr', $all_font_opt ); die('Success.Fonts updated. Total #'.$tfc.' fonts recieved, the page will be refreshed.'); } /* foreach ($json['items'] as $gf_item) { $family = $gf_item['family']; $family_slug = strtolower($gf_item['family']); $variants = $gf_item['variants']; $subsets = $gf_item['subsets']; $files = $gf_item['files']; $lastModified = $gf_item['lastModified']; // var_dump($json); }*/ } //echo $result; } } add_action("wp_ajax_eo_get_gwf_variant", "eo_get_gwf_variant"); function eo_get_gwf_variant($ftg = NULL) { // _eo-todo: add nonce check // We should have Google fonts one way or another // var_dump($ftg); $eo_fnts_prep = get_option ( 'eo_all_fonts_arr' ); $def_gf_opt = get_option ( 'eo_def_gf_array' ); if ( ! empty($eo_fnts_prep) && is_array($eo_fnts_prep) ) { //it's ok. } else if ( ! empty($def_gf_opt) && is_array($def_gf_opt) ) { $eo_fnts_prep = $def_gf_opt; } else { die("No Google Fonts found ! #eo_err_code: 71"); } if ( isset($_POST["font_to_get"]) ) { $font_to_get = strtolower(str_replace("+","",$_POST["font_to_get"]) ); } else if ( isset($ftg) ) { $font_to_get = strtolower(str_replace("+","",$ftg) ); } else { // die("["regular"]"); } $face_trans = get_transient( 'eo_gwf_variants'); if($face_trans) { // delete_transient( 'eo_comb_faces_trans'); $gwf_face_variants = $face_trans; } else { $gwf_faces = $eo_fnts_prep["gwf_font"]["font_faces"]; $gwf_face_variants = array(); foreach ( $gwf_faces as $fslug =>$gwf_face ) { $gwf_face_variants[$fslug] = $gwf_face["variants"]; } /// $face_variants = $eo_fnts_prep["gwf_font"]["font_faces"][$font_to_get]; // save the restructured array for later use for a short time - 120 mins set_transient( 'eo_gwf_variants', $gwf_face_variants, 60 * 1200 ); } $fvar_ret = $gwf_face_variants[$font_to_get]; // Return for php or die for ajax. if ( isset($_POST["font_to_get"]) ) { die( json_encode($fvar_ret)); } else if ( isset($ftg) ) { return $fvar_ret; } } add_action("wp_ajax_eo_del_opt", "eo_del_opt"); function eo_del_opt() { global $wpdb, $theme_opt_slug; if ( isset($_GET["del_what"]) ) { $delwg = $_GET["del_what"]; if($delwg == "eo_transients") { if ( !wp_verify_nonce( $_REQUEST['nonce'], "eo_del_trans_nonce")) { exit("Cheating ??"); } } } else { if ( !wp_verify_nonce( $_REQUEST['nonce'], "eo_del_opt_nonce")) { exit("Cheating ??"); } } $optionsframework_settings = get_option('optionsframework' ); // _eo-review : Need a more unique prefix_ $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'cpt_%'" ); ($theme_opt_slug) ? $the_opt_id = $theme_opt_slug : $the_opt_id = get_option( $optionsframework_settings['id'] ); $del_wht = $_REQUEST["del_what"]; $acc_del_opts = array($the_opt_id,"eo_transients","eo_const","eo_custom_fields_opt","eo_all_fonts_arr","eo_opts","eo_gen_opt_cl","eo_def_gf_array","eo_googlefonts_arr"); if($del_wht == "start_over") { // $what_to_del = $del_wht; $last_op = end($acc_del_opts); foreach ( $acc_del_opts as $del_opt) { $chck_opt_ex = get_option( $del_opt ); if($chck_opt_ex) { delete_option($del_opt); if( $last_op == $del_opt ) { $result = "All options & settings -should be- deleted"; } else { $result = "Whoops could not delete all options"; } } } } else if ( in_array($del_wht,$acc_del_opts) ) { if($del_wht == "eo_transients") { if ( is_multisite() ) { $all_sites = $wpdb->get_results( "SELECT * FROM $wpdb->blogs" ); if ( $all_sites ) { foreach ($all_sites as $site) { $wpdb->set_blog_id( $site->blog_id ); $wpdb->query( "DELETE FROM `{$wpdb->prefix}options` WHERE `option_name` LIKE ('_transient_eo_%')" ); } } } else { $wpdb->query( "DELETE FROM `{$wpdb->prefix}options` WHERE `option_name` LIKE ('_transient_eo_%')" ); $wpdb->query( "DELETE FROM `{$wpdb->prefix}options` WHERE `option_name` LIKE ('_transient_timeout_eo_%')" ); // die("Transients deleted"); } } $what_to_del = $del_wht; delete_option($del_wht); } else { exit("Cheating ?? #Trying to delete something else ?!!"); } if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { $result = json_encode($result); echo $result; } else { header("Location: ".$_SERVER["HTTP_REFERER"]); } die($result); } function get_bsw_theme () { } function eo_get_bsw_theme() { die("disabled"); } /** * Add "has-submenu" CSS class to navigation menu items that have children in a * submenu. */ function nav_menu_item_parent_classing( $classes, $item ) { global $wpdb; $has_children = $wpdb -> get_var( "SELECT COUNT(meta_id) FROM {$wpdb->prefix}postmeta WHERE meta_key='_menu_item_menu_item_parent' AND meta_value='" . $item->ID . "'" ); if ( $has_children > 0 ) { array_push( $classes, "dropdown" ); } return $classes; } add_filter( "nav_menu_css_class", "nav_menu_item_parent_classing", 10, 2 ); // _eo custom wp page menu since default doesnt support ul class for bootstrap function eo_wp_page_menu( $args = array() ) { $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => ''); $args = wp_parse_args( $args, $defaults ); $args = apply_filters( 'wp_page_menu_args', $args ); $menu = ''; $list_args = $args; // var_dump($args); // Show Home in the menu if ( ! empty($args['show_home']) ) { if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] ) $text = __('Home'); else $text = $args['show_home']; $class = ''; if ( is_front_page() && !is_paged() ) $class = 'class="current_page_item active"'; $menu .= '
  • ' . $args['link_before'] . $text . $args['link_after'] . '
  • '; // If the front page is a page, add it to the exclude list if (get_option('show_on_front') == 'page') { if ( !empty( $list_args['exclude'] ) ) { $list_args['exclude'] .= ','; } else { $list_args['exclude'] = ''; } $list_args['exclude'] .= get_option('page_on_front'); } } $list_args['echo'] = false; $list_args['title_li'] = ''; $list_args['walker'] = new eo_Walker_Page(); $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) ); //var_dump($menu); if ( $menu ) $menu = ''; $menu = '
    ' . $menu . "
    \n"; $menu = apply_filters( 'wp_page_menu', $menu, $args ); if ( $args['echo'] ) echo $menu; else return $menu; } function eo_main_nav_fallback() { eo_wp_page_menu( array( 'show_home' => true, 'menu_class' => 'top-nav clearfix navfback', // adding custom nav class 'ul_class' => 'nav navbar-nav ', // adding custom nav class // 'include' => 9999, // 'show_home' => true, 'exclude' => '', 'echo' => true, 'link_before' => '', // before each link 'link_after' => '' // after each link ) ); } add_action( 'admin_bar_menu', 'toolbar_link_to_mypage', 999 ); function toolbar_link_to_mypage( $wp_admin_bar ) { $the_th_slug = eo_get_cons("eo_theme","slug"); ($the_th_slug) ? $theme_slug = $the_th_slug : $theme_slug = 'options-framework'; $args = array( 'id' => 'bsul_aml', 'title' => 'Bootstrap UL options', $url = admin_url( 'themes.php?page='.$theme_slug ), 'href' => $url, 'meta' => array( 'class' => 'bsul-theme-opt' ) ); $wp_admin_bar->add_node( $args ); } //get_template_part('custom-functions'); // custom functions /* TODO LIST _eo-todo: fontawesome menus _eo-todo: adjustable layout - main-sidebar colum widths, multiple sidebar _eo-todo: code-cleanup _eo-todo: Sort Google fonts by -last modified/updated- _eo-todo: Pinned posts _eo-todo: Options Import / Export ? _eo-todo: Backgrounds -Subtle Patterns - ? _eo-todo: Reorganize options _eo-todo: Dismissable help / alerts _eo-todo: Stackable / dismissable options _eo-todo: Validation & sanity & dependancy checks for options _eo-todo: Fix crash on adding new groups? _eo-todo: Dismiss blocks in admin. ? _eo-todo: Extended font support for Cufon, FontSquirrel etc. ? _eo-todo: make left side menu drag & drop sortable ? _eo-todo: Debug options for the end user ? _eo-todo: Better docs ? _eo-todo: Look for / build a child theme repository like Bootswatch ? _eo-todo: Check font selects for no-js DONE LIST _eo-done: chosen disabled - font variant select conflict _eo-done: [Shortcodes] - Not allowed in themes. _eo-done: Update Google Font function for php-free js-only since WP doesnt allow */ ?>