/** * This function is for displaying the "Secondary Navigation" bar. */ function calibrefx_do_subnav() { global $calibrefx; /** Do nothing if menu not supported */ if (!calibrefx_nav_menu_supported('secondary')) { return; } $calibrefx->load->library('walker_nav_menu'); $subnav = ''; $args = ''; if (calibrefx_get_option('subnav')) { if (has_nav_menu('secondary')) { $args = array('theme_location' => 'secondary', 'container' => '', 'menu_class' => 'nav nav-pills menu-secondary menu superfish', 'echo' => 0, 'walker' => new CFX_Walker_Nav_menu()); $subnav = wp_nav_menu($args); } $subnav_output = sprintf(' <div id="subnav"> %2$s %1$s %3$s </div> <!-- end #subnav -->', $subnav, calibrefx_put_wrapper('subnav', 'open', false), calibrefx_put_wrapper('subnav', 'close', false)); echo apply_filters('calibrefx_do_subnav', $subnav_output, $subnav, $args); } }
/** * Output description * * @return string $description */ function calibrefx_meta_description() { global $post, $wp_query, $wp_locale; $desc = ''; if (is_home() || is_front_page()) { $desc = get_bloginfo('description'); } elseif (is_singular()) { $desc = calibrefx_truncate_phrase($post->post_content, calibrefx_get_option('content_archive_limit')); } elseif (is_archive()) { if (is_category()) { $desc = category_description(get_query_var('cat')); } elseif (is_tax()) { $term = $wp_query->get_queried_object(); $desc = term_description($term->term_id, $term->taxonomy); } elseif (is_year()) { $desc = __('All posts in ', 'calibrefx') . get_query_var('year'); } elseif (is_month()) { $desc = __('All Posts in ', 'calibrefx') . $wp_locale->get_month(get_query_var('monthnum')) . ' ' . get_query_var('year'); } elseif (is_day()) { $desc = __('All Posts in ', 'calibrefx') . get_query_var('day') . ' ' . $wp_locale->get_month(get_query_var('monthnum')) . ' ' . get_query_var('year'); } elseif (is_author()) { $desc = get_user_meta($wp_query->queried_object->ID, 'intro_text', true); } elseif (is_post_type_archive()) { $post_type = $wp_query->get_queried_object(); $desc = $post_type->description; } } elseif (is_404()) { $desc = __('Page not found ', 'calibrefx'); } $desc = str_replace(array('<p>', '</p>'), array('', ''), $desc); $desc = htmlentities($desc); return apply_filters('calibrefx_meta_description', $desc); }
function contact_do_map($atts, $content = null) { extract(shortcode_atts(array('height' => '300'), $atts)); $contact_map = calibrefx_get_option('contact_map'); $coordinates = explode(',', $contact_map); $map_x = $coordinates[0]; $map_y = $coordinates[1]; $output = '[map x="' . $map_x . '" y="' . $map_y . '" height="' . $height . '"]'; return do_shortcode($output); }
/** * Iteratively update calibreFx to the latest version */ function calibrefx_upgrade() { $calibrefx_db_version = calibrefx_get_option('calibrefx_db_version'); //Avoid infinited loop if (empty($calibrefx_db_version)) { calibrefx_set_option('calibrefx_db_version', FRAMEWORK_DB_VERSION); } calibrefx_set_option('calibrefx_version', FRAMEWORK_VERSION); wp_cache_flush(); //refresh option caches if ($calibrefx_db_version >= FRAMEWORK_DB_VERSION) { return; } do_action('calibrefx_upgraded'); }
/** * Display widget content. * * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget */ function widget($args, $instance) { extract($args); $instance = wp_parse_args((array) $instance, $this->defaults); echo $before_widget; if (!empty($instance['title'])) { echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title; } ?> <div class="contact-wrapper"> <?php if ($instance['show_map']) { ?> <div class="contact-map"> <?php echo do_shortcode('[contact_map height="' . $instance['map_height'] . '"]'); ?> </div> <?php } ?> <div class="contact-detail"> <?php $personal_info_output = '<ul class="personal-info fa-ul">'; if ($instance['show_name']) { $personal_info_output .= '<li class="contact-name"><i class="fa fa-li fa-user fa-fw icon-contact-name"></i>' . calibrefx_get_option('contact_name') . '</li>'; } if ($instance['show_email']) { $personal_info_output .= '<li class="contact-email"><a href="mailto:' . calibrefx_get_option('contact_email') . '"><i class="fa fa-li fa-envelope fa-fw icon-contact-email"></i>' . calibrefx_get_option('contact_email') . '</a></li>'; } if ($instance['show_phone']) { $personal_info_output .= '<li class="contact-phone"><a href="' . calibrefx_get_option('contact_phone') . '"><i class="fa fa-li fa-phone fa-fw icon-contact-phone"></i>' . calibrefx_get_option('contact_phone') . '</a></li>'; } if ($instance['show_mobile_phone']) { $personal_info_output .= '<li class="contact-fax"><a href="' . calibrefx_get_option('contact_mobile_phone') . '"><i class="fa fa-li fa-mobile fa-fw icon-contact-mobile"></i>' . calibrefx_get_option('contact_mobile_phone') . '</a></li>'; } if ($instance['show_address']) { $personal_info_output .= '<li class="contact-address"><i class="fa fa-li fa-home fa-fw icon-contact-address"></i>' . nl2br(calibrefx_get_option('contact_address')) . '</li>'; } $personal_info_output .= '</ul>'; $personal_info_output = apply_filters('calibrefx_personal_info_output', $personal_info_output); echo $personal_info_output; ?> </div> </div> <?php echo $after_widget; }
/** * Print outs favicon */ function calibrefx_print_favicon() { if (file_exists(CALIBREFX_IMAGES_URI . '/ico/favicon.ico')) { $favicon = CALIBREFX_IMAGES_URL . '/ico/favicon.ico'; } else { $favicon = CALIBREFX_IMAGES_URL . '/favicon.ico'; } //Check if child themes have the favicon.ico if (file_exists(CHILD_URI . '/favicon.ico')) { $favicon = CHILD_URL . '/favicon.ico'; } if (file_exists(CHILD_IMAGES_URI . '/favicon.ico')) { $favicon = CHILD_IMAGES_URL . '/favicon.ico'; } if (calibrefx_get_option('favicon')) { $favicon = calibrefx_get_option('favicon'); } $favicon = apply_filters('calibrefx_favicon_url', $favicon); if ($favicon) { echo '<link rel="Shortcut Icon" href="' . esc_url($favicon) . '" type="image/x-icon" />' . "\n"; } }
function disable_responsive() { if (calibrefx_is_responsive_enabled()) { return; } ?> <style type="text/css"> /* Non-responsive overrides * * Utilitze the following CSS to disable the responsive-ness of the container, * grid system, and navbar. */ /* Reset the container */ body.non-responsive, body.non-responsive .container { width: <?php echo calibrefx_get_option('calibrefx_layout_width'); ?> px !important; max-width: none !important; } </style> <?php }
/** * Output All the meta options based on given metabox id * * @param Object $settings_obj Screen Object * @param string $metabox_id Meta box id * @return void */ function calibrefx_do_meta_options($settings_obj, $metabox_id) { global $calibrefx_meta_options, $calibrefx; do_action($metabox_id . '_options'); $calibrefx->load->library('form'); $settings_field = $settings_obj->settings_field; foreach ($calibrefx_meta_options as $option_group_id => $option_group) { if (!isset($option_group['metabox']) or $option_group['metabox'] != $metabox_id) { continue; } if (empty($option_group['options'])) { continue; } $options = $option_group['options']; if (!$options) { continue; } ksort($options); ?> <?php if (!empty($option_group['title'])) { ?> <h3 class="section-title"><?php echo esc_attr($option_group['title']); ?> </h3><?php } ?> <div id="<?php echo esc_attr($option_group_id); ?> "> <?php foreach ($options as $option_priority) { foreach ($option_priority as $option_name => $option) { //backward compatibility if (empty($option['option_attr'])) { $option['option_attr'] = array(); } $attr = ''; foreach ($option['option_attr'] as $key => $val) { $attr .= ' ' . $key . '="' . $val . '"'; } ?> <div class="option-item"> <p <?php echo $attr; ?> > <?php switch ($option['option_type']) { case 'hidden': echo $calibrefx->form->hidden($settings_field . '[' . $option_name . ']', calibrefx_get_option($option_name), $option['option_attr']); break; case 'blank': $classes = ''; if (isset($option['option_attr']['class'])) { $classes = $option['option_attr']['class']; unset($option['option_attr']['class']); } echo '<label for="' . $settings_field . '[' . $option_name . ']">' . $option['option_label'] . '</label>'; break; case 'textinput': case 'textarea': case 'password': case 'colorpicker': //we need to extract the class from the array $classes = ''; if (isset($option['option_attr']['class'])) { $classes = $option['option_attr']['class']; unset($option['option_attr']['class']); } echo '<label for="' . $settings_field . '[' . $option_name . ']">' . $option['option_label'] . '</label>'; echo $calibrefx->form->{$option['option_type']}($settings_field . '[' . $option_name . ']', calibrefx_get_option($option_name), $classes, $option['option_attr']); break; case 'upload': wp_enqueue_media(); //we need to extract the class from the array $classes = ''; if (isset($option['option_attr']['class'])) { $classes = $option['option_attr']['class']; unset($option['option_attr']['class']); } $option_name_id = $option_name . '_id'; $image = calibrefx_get_option($option_name); if ($image) { echo '<div class="preview_image image_preview" id="preview_' . $option_name . '"><img src="' . calibrefx_get_option($option_name) . '" /></div>'; } else { echo '<div class="preview_image image_preview" id="preview_' . $option_name . '"></div>'; } echo '<label for="' . $settings_field . '[' . $option_name . ']">' . $option['option_label'] . '</label>'; echo $calibrefx->form->textinput($settings_field . '[' . $option_name . ']', calibrefx_get_option($option_name), $classes, $option['option_attr']); echo $calibrefx->form->hidden($settings_field . '[' . $option_name_id . ']', calibrefx_get_option($option_name_id), array('id' => $option_name_id, 'class' => 'image_id')); echo '<div class="upload_button_div"> <span class="button upload_image_button" id="upload_' . $option_name . '">Upload Image</span> <span class="button image_reset_button hide image_reset" id="reset_' . $option_name . '">Remove</span> <div class="clear"></div> </div>'; break; case 'texteditor': echo '<label for="' . $settings_field . '[' . $option_name . ']">' . $option['option_label'] . '</label>'; echo $calibrefx->form->texteditor($settings_field . '[' . $option_name . ']', calibrefx_get_option($option_name)); break; case 'checkbox': $classes = 'calibrefx-settings-checkbox'; if (isset($option['option_attr']['class'])) { $classes .= ' ' . $option['option_attr']['class']; unset($option['option_attr']['class']); } $attr = array_merge(array('target' => $settings_field . '-' . $option_name, 'class' => $classes), $option['option_attr']); echo $calibrefx->form->{$option['option_type']}($settings_field . '-checkbox-' . $option_name, $option['option_items'], calibrefx_get_option($option_name), $option['option_label'], false, $attr); echo $calibrefx->form->hidden($settings_field . '[' . $option_name . ']', calibrefx_get_option($option_name), array('id' => $settings_field . '-' . $option_name)); break; case 'radio': case 'select': echo '<label for="' . $settings_field . '[' . $option_name . ']">' . $option['option_label'] . '</label>'; echo $calibrefx->form->{$option['option_type']}($settings_field . '[' . $option_name . ']', $option['option_items'], calibrefx_get_option($option_name), '', $option['option_attr']); break; /*case 'description': echo '<p class="description">'. $option['option_label'] . '</p>'; break;*/ /*case 'description': echo '<p class="description">'. $option['option_label'] . '</p>'; break;*/ case 'custom': if (isset($option['option_custom'])) { echo $option['option_custom']; } break; } ?> </p> <?php if (!empty($option['option_description'])) { ?> <p class="description"> <?php echo $option['option_description']; ?> </p> <?php } ?> </div> <?php } ?> <?php } ?> </div> <?php } }
/** * Show default layout box */ function layout_box() { global $calibrefx; calibrefx_add_meta_group('layout-settings', 'layout-general-settings', __('Layout Settings', 'calibrefx')); calibrefx_add_meta_group('layout-settings', 'layout-type-settings', __('General Layout Settings', 'calibrefx')); calibrefx_add_meta_group('layout-settings', 'feature-image-settings', __('Feature Image Settings', 'calibrefx')); //For Layout Settings add_action('layout-settings_options', function () { calibrefx_add_meta_option('layout-general-settings', 'layout_type', __('How would you like the main layout of the website?', 'calibrefx'), array('option_type' => 'select', 'option_items' => apply_filters('calibrefx_layout_type_options', array('static' => __('Fix Width Layout', 'calibrefx'), 'fluid' => __('Fluid Layout', 'calibrefx'))), 'option_default' => 'static', 'option_filter' => 'safe_text'), 1); calibrefx_add_meta_option('layout-general-settings', 'calibrefx_layout_width', __('Layout Width (pixels)', 'calibrefx'), array('option_type' => 'textinput', 'option_default' => '940', 'option_filter' => 'integer', 'option_attr' => array('class' => 'calibrefx_layout_width')), 5); calibrefx_add_meta_option('layout-general-settings', 'calibrefx_layout_wrapper_fixed', __('Use Wrapper Border Box', 'calibrefx'), array('option_type' => 'checkbox', 'option_items' => '1', 'option_default' => '', 'option_filter' => 'integer', 'option_description' => __('Check this if you want to have wrapper box layout.', 'calibrefx'), 'option_attr' => array('class' => 'calibrefx_layout_width')), 6); calibrefx_add_meta_option('layout-general-settings', 'responsive_disabled', __('Check this to disable responsive', 'calibrefx'), array('option_type' => 'checkbox', 'option_items' => '1', 'option_default' => '0', 'option_filter' => 'integer', 'option_description' => __('Check this if you want to disable mobile responsive feature', 'calibrefx')), 15); }); //For General Layout Settings add_action('layout-settings_options', function () { calibrefx_add_meta_option('layout-type-settings', 'site_layout', __('Pick your general layout column', 'calibrefx'), array('option_type' => 'custom', 'option_custom' => calibrefx_layout_selector(array('name' => 'calibrefx-settings[site_layout]', 'selected' => calibrefx_get_option('site_layout'), 'echo' => false)), 'option_default' => '', 'option_filter' => '', 'option_attr' => array('class' => 'calibrefx-layout-selector'), 'option_description' => __('You can choose your Website layout. You can override per post / page later.', 'calibrefx')), 1); calibrefx_add_meta_option('layout-type-settings', 'sidebar_width', __('Customize Your Sidebar Width', 'calibrefx'), array('option_type' => 'select', 'option_items' => array('2' => __('2/12 of total columns', 'calibrefx'), '3' => __('3/12 of total columns', 'calibrefx'), '4' => __('4/12 of total columns', 'calibrefx'), '5' => __('5/12 of total columns', 'calibrefx'), '6' => __('6/12 of total columns', 'calibrefx')), 'option_default' => '4', 'option_attr' => array('class' => 'calibrefx-sidebar-width'), 'option_filter' => 'safe_text'), 1); }); //For Feature Image Layout Settings add_action('layout-settings_options', function () { calibrefx_add_meta_option('feature-image-settings', 'feature_image_layout', __('How do you want to show the feature image?', 'calibrefx'), array('option_type' => 'select', 'option_items' => apply_filters('calibrefx_layout_type_options', array('thumbnail' => __('Square Thumbnail', 'calibrefx'), 'full' => __('Full Width', 'calibrefx'), 'none' => __('None', 'calibrefx'))), 'option_default' => 'full', 'option_filter' => 'safe_text'), 1); }); calibrefx_do_meta_options($calibrefx->theme_settings, 'layout-settings'); }
/** * Display widget content. * * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget */ function widget($args, $instance) { extract($args); $instance = wp_parse_args((array) $instance, $this->defaults); echo $before_widget; $fb_url = esc_attr(calibrefx_get_option('facebook_fanpage')); $tw_url = esc_attr(calibrefx_get_option('twitter_profile')); $youtube_url = esc_attr(calibrefx_get_option('youtube_channel')); $gplus_url = esc_attr(calibrefx_get_option('gplus_page')); $linkedin_profile = esc_attr(calibrefx_get_option('linkedin_profile')); $pinterest_profile = esc_attr(calibrefx_get_option('pinterest_profile')); $instagram_profile = esc_attr(calibrefx_get_option('instagram_profile')); $github_profile = esc_attr(calibrefx_get_option('github_profile')); if (!empty($instance['title'])) { echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title; } $output = ''; $output .= '<div class="social-media-wrapper"><ul class="social-media-list ' . $instance['layout'] . '">'; $output .= apply_filters('calibrefx_social_widget_before_list', ''); if (!empty($fb_url)) { $output .= '<li class="facebook"> <a href="' . $fb_url . '" title="' . __('View us on facebook', 'calibrefx') . '" target="_blank"> <i class="social-icon cfxicons cfxicon-facebook' . '"></i> ' . ($instance['layout'] == 'vertical' ? ' <span class="social-media-label">' . stripslashes($instance['label_facebook']) : '') . '</span> </a> </li>'; } if (!empty($tw_url)) { $output .= '<li class="twitter"> <a href="' . $tw_url . '" title="' . __('View us on twitter', 'calibrefx') . '" target="_blank"> <i class="social-icon cfxicons cfxicon-twitter' . '"></i> ' . ($instance['layout'] == 'vertical' ? ' <span class="social-media-label">' . stripslashes($instance['label_twitter']) : '') . '</span> </a> </li>'; } if (!empty($gplus_url)) { $output .= '<li class="gplus"> <a href="' . $gplus_url . '" title="' . __('View us on google+', 'calibrefx') . '" target="_blank"> <i class="social-icon cfxicons cfxicon-google-plus' . '"></i> ' . ($instance['layout'] == 'vertical' ? ' <span class="social-media-label">' . stripslashes($instance['label_gplus']) : '') . '</span> </a> </li>'; } if (!empty($youtube_url)) { $output .= '<li class="youtube"> <a href="' . $youtube_url . '" title="' . __('View our youtube channel', 'calibrefx') . '" target="_blank"> <i class="social-icon cfxicons cfxicon-youtube' . '"></i> ' . ($instance['layout'] == 'vertical' ? ' <span class="social-media-label">' . stripslashes($instance['label_youtube']) : '') . '</span> </a> </li>'; } if (!empty($linkedin_profile)) { $output .= '<li class="linkedin"> <a href="' . $linkedin_profile . '" title="' . __('View us on linkedin', 'calibrefx') . '" target="_blank"> <i class="social-icon cfxicons cfxicon-linkedin' . '"></i> ' . ($instance['layout'] == 'vertical' ? ' <span class="social-media-label">' . stripslashes($instance['label_linkedin']) : '') . '</span> </a> </li>'; } if (!empty($pinterest_profile)) { $output .= '<li class="pinterest"> <a href="' . $pinterest_profile . '" title="' . __('View us on pinterest', 'calibrefx') . '" target="_blank"> <i class="social-icon cfxicons cfxicon-pinterest' . '"></i> ' . ($instance['layout'] == 'vertical' ? ' <span class="social-media-label">' . stripslashes($instance['label_pinterest']) : '') . '</span> </a> </li>'; } if (!empty($instagram_profile)) { $output .= '<li class="instagram"> <a href="' . $instagram_profile . '" title="' . __('View us on instagram', 'calibrefx') . '" target="_blank"> <i class="social-icon cfxicons cfxicon-instagram' . '"></i> ' . ($instance['layout'] == 'vertical' ? ' <span class="social-media-label">' . stripslashes($instance['label_instagram']) : '') . '</span> </a> </li>'; } if (!empty($github_profile)) { $output .= '<li class="github"> <a href="' . $github_profile . '" title="' . __('View us on github', 'calibrefx') . '" target="_blank"> <i class="social-icon cfxicons cfxicon-github' . '"></i> ' . ($instance['layout'] == 'vertical' ? ' <span class="social-media-label">' . stripslashes($instance['label_github']) : '') . '</span> </a> </li>'; } $output .= apply_filters('calibrefx_social_widget_after_list', ''); $output .= '</ul></div>'; $widget_output = apply_filters('calibrefx_social_widget_output', $output, $instance, $fb_url, $tw_url, $gplus_url, $youtube_url, $linkedin_profile, $pinterest_profile); echo $widget_output; echo $after_widget; }
/** * Show Tracking Scripts */ function calibrefx_show_tracking_scripts() { global $post; $analytic_id = calibrefx_get_option('analytic_id'); $google_tagmanager_code = calibrefx_get_option('google_tagmanager_code'); $facebook_tracking_code = calibrefx_get_option('facebook_tracking_code'); if (!empty($analytic_id)) { echo "\n<script type='text/javascript'>\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', '{$analytic_id}']);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement( 'script' ); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ( 'https:' == document.location.protocol ? 'https://ssl' : 'http://www' ) + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName( 'script' )[0]; s.parentNode.insertBefore(ga, s);\n })();\n</script>\n "; } if (!empty($google_tagmanager_code)) { echo stripslashes(cap_attr($google_tagmanager_code)); } if (!empty($facebook_tracking_code)) { echo stripslashes(cap_attr($facebook_tracking_code)); } }
/** * Show the mobile special menu */ function calibrefx_do_mobile_nav() { global $calibrefx; $calibrefx->load->library('walker_nav_menu'); $nav = ''; $args = ''; $args = array('theme_location' => 'mobile', 'container' => '', 'menu_class' => calibrefx_get_option('nav_fixed_top') ? 'navbar navbar-default navbar-fixed-top menu-primary menu ' : 'nav navbar-nav menu-primary menu ', 'echo' => 0, 'walker' => $calibrefx->walker_nav_menu); $nav = wp_nav_menu($args); $nav_class = apply_filters('nav_class', calibrefx_row_class()); $nav_output = sprintf(' <div id="mobile-nav" class="navbar navbar-default"> %1$s </div> <!-- end #mobile-nav -->', $nav); echo apply_filters('calibrefx_do_mobile_nav', $nav_output, $nav, $args); }
/** * Register the settings option in wp_options. * * @return null Returns early if not on the correct admin page. */ public function register_settings() { /** If this page doesn't store settings, no need to register them */ if (!$this->settings_field) { return; } register_setting($this->settings_field, $this->settings_field); add_option($this->settings_field, $this->default_settings); if (!isset($_REQUEST['page']) or $this->page_id != absint($_REQUEST['page'])) { return; } if (calibrefx_get_option('reset', $this->settings_field)) { //prevent redirect loop calibrefx_set_option('reset', 0); wp_cache_flush(); //refresh option caches if (update_option($this->settings_field, $this->default_settings)) { calibrefx_admin_redirect($this->page_id, array('reset' => 'true')); } else { calibrefx_admin_redirect($this->page_id, array('error' => 'true')); } exit; } }
/** * Check if responsive features is enabled * @return boolean true if responsive enabled */ function calibrefx_is_responsive_enabled() { return get_theme_support('calibrefx-responsive-style') and !calibrefx_get_option('responsive_disabled'); }
/** * Defines the comment form, hooked to <code>calibrefx_comment_form()</code> * */ function calibrefx_do_comment_form() { /** Bail if comments are closed for this post type */ if (is_page() && !calibrefx_get_option('comments_pages') || is_single() && !calibrefx_get_option('comments_posts')) { return; } comment_form(); }
/** * Display Post Navigation */ function calibrefx_posts_nav() { $nav = calibrefx_get_option('posts_nav'); switch ($nav) { case 'disabled': //do nothing break; case 'numeric': calibrefx_numeric_posts_nav(); break; case 'prev-next': calibrefx_prev_next_posts_nav(); break; case 'older-newer': default: calibrefx_older_newer_posts_nav(); break; } }
/** * Echo option if exist * @access public * @uses calibrefx_get_option * @param string option key * @param object CFX_Model, default null * @return void */ function calibrefx_option($key, $group = null) { echo calibrefx_get_option($key, $group); }
function webfont_typography() { global $calibrefx; $font_color = esc_attr(calibrefx_get_option('custom_font_color')); $permalink_color = esc_attr(calibrefx_get_option('custom_permalink_color')); $permalink_hover_color = esc_attr(calibrefx_get_option('custom_permalink_hover_color')); calibrefx_add_meta_group('typography-header-text-settings', 'typography-header-text-settings', __('Header Text Typography', 'calibrefx')); add_action('typography-header-text-settings_options', function () { global $fonts; $font_values = array(); foreach ($fonts as $font => $value) { $font_values[$font] = $font; } calibrefx_add_meta_option('typography-header-text-settings', 'custom_header_font_family', __('', 'calibrefx'), array('option_type' => 'select', 'option_items' => $font_values, 'option_default' => 'Titillium Web', 'option_filter' => 'safe_text', 'option_description' => __('This setting is for all the header (h1, h2, etc.) text. Sizes will vary according to the css file', 'calibrefx')), 1); }); calibrefx_do_meta_options($calibrefx->theme_settings, 'typography-header-text-settings'); calibrefx_add_meta_group('typography-body-text-settings', 'typography-body-text-settings', __('Body Text Typography', 'calibrefx')); add_action('typography-body-text-settings_options', function () { calibrefx_add_meta_option('typography-body-text-settings', 'custom_font_size', __('Font Size', 'calibrefx'), array('option_type' => 'select', 'option_items' => array('9' => '9px', '10' => '10px', '11' => '11px', '12' => '12px', '13' => '13px', '14' => '14px', '15' => '15px', '16' => '16px', '17' => '17px', '18' => '18px', '19' => '19px', '20' => '20px', '21' => '21px', '22' => '22px', '23' => '23px', '24' => '24px'), 'option_default' => '16', 'option_filter' => 'safe_text', 'option_description' => ''), 1); global $fonts; $font_values = array(); foreach ($fonts as $font => $value) { $font_values[$font] = $font; } calibrefx_add_meta_option('typography-body-text-settings', 'custom_font_family', __('Font Family', 'calibrefx'), array('option_type' => 'select', 'option_items' => $font_values, 'option_default' => 'Titillium Web', 'option_filter' => 'safe_text', 'option_description' => ''), 1); calibrefx_add_meta_option('typography-body-text-settings', 'custom_font_color', __('Font Color', 'calibrefx'), array('option_type' => 'colorpicker', 'option_default' => '#414141', 'option_filter' => 'no_html', 'option_description' => __('Please set this option if you want to use your custom styling for body text paragraph', 'calibrefx')), 1); }); calibrefx_do_meta_options($calibrefx->theme_settings, 'typography-body-text-settings'); calibrefx_add_meta_group('typography-permalinks-settings', 'typography-permalinks-settings', __('Permalinks Setting', 'calibrefx')); add_action('typography-permalinks-settings_options', function () { calibrefx_add_meta_option('typography-permalinks-settings', 'custom_permalink_color', __('Permalinks Color', 'calibrefx'), array('option_type' => 'colorpicker', 'option_default' => '', 'option_filter' => 'no_html', 'option_description' => __('define your permalinks color here, please leave it blank by removing the color code, if you want to use pre-defined color.', 'calibrefx')), 1); calibrefx_add_meta_option('typography-permalinks-settings', 'custom_permalink_hover_color', __('Permalinks Hover Color', 'calibrefx'), array('option_type' => 'colorpicker', 'option_default' => '', 'option_filter' => 'no_html', 'option_description' => __('define your permalinks hover color here, please leave it blank by removing thecolor code, if you want to use pre-defined color.', 'calibrefx')), 1); }); calibrefx_do_meta_options($calibrefx->theme_settings, 'typography-permalinks-settings'); }
/** * This function/filter adds new classes to the <body> * so that we can use psuedo-variables in our CSS file, * which helps us achieve multiple header layouts with minimal code * * @since 0.2.2 */ function calibrefx_header_body_classes($classes) { // add header classes to $classes array if (!is_active_sidebar('header-right')) { $classes[] = 'header-full-width'; } if (current_theme_supports('calibrefx-custom-header') && ('image' == calibrefx_get_option('blog_title') || 'blank' == get_header_textcolor())) { $classes[] = 'header-image'; } if (calibrefx_is_responsive_enabled()) { $classes[] = 'responsive'; } else { $classes[] = 'non-responsive'; } if (calibrefx_layout_is_fluid()) { $classes[] = 'fluid'; } else { $classes[] = 'static'; } $custom_body = calibrefx_get_custom_field('_calibrefx_custom_body_class'); if (!empty($custom_body)) { $classes[] = $custom_body; } // return filtered $classes return $classes; }
/** * Produces the link to the current post comments. * * Supported shortcode attributes are: * after (output after link, default is empty string), * before (output before link, default is empty string), * hide_if_off (hide link if comments are off, default is 'enabled' (true) ), * more (text when there is more than 1 comment, use % character as placeholder * for actual number, default is '% Comments' ) * one (text when there is exactly one comment, default is '1 Comment' ), * zero (text when there are no comments, default is 'Leave a Comment' ). * */ function calibrefx_post_comments_shortcode($atts) { $defaults = array('after' => '', 'before' => ' • ', 'hide_if_off' => 'enabled', 'more' => __('% Comments', 'calibrefx'), 'one' => __('1 Comment', 'calibrefx'), 'zero' => __('Leave a Comment', 'calibrefx')); $is_facebook_comment_enabled = calibrefx_get_option('facebook_comments'); if ($is_facebook_comment_enabled) { return; } $atts = shortcode_atts($defaults, $atts); if ((!calibrefx_get_option('comments_posts') || !comments_open()) && 'enabled' === $atts['hide_if_off']) { return; } ob_start(); comments_number($atts['zero'], $atts['one'], $atts['more']); $comments = ob_get_clean(); $comments = sprintf('<a href="%s">%s</a>', get_comments_link(), $comments); $output = sprintf('<span class="post-comments">%2$s%1$s%3$s</span>', $comments, $atts['before'], $atts['after']); return apply_filters('calibrefx_post_comments_shortcode', $output, $atts); }
/** * Filter the feed URI if the user has input a custom feed URI. */ function calibrefx_feed_links_filter($output, $feed) { $feed_uri = calibrefx_get_option('feed_uri'); $comments_feed_uri = calibrefx_get_option('comments_feed_uri'); if ($feed_uri && !strpos($output, 'comments') && ('' == $feed || 'rss2' == $feed || 'rss' == $feed || 'rdf' == $feed || 'atom' == $feed)) { $output = esc_url($feed_uri); } if ($comments_feed_uri && strpos($output, 'comments')) { $output = esc_url($comments_feed_uri); } return $output; }
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?> ; charset=<?php bloginfo('charset'); ?> " /> <link rel="profile" href="http://gmpg.org/xfn/11"> <?php if ('open' == get_option('default_ping_status')) { echo '<link rel="pingback" href="' . esc_url(get_bloginfo('pingback_url')) . '" />' . "\n"; } if (calibrefx_is_responsive_enabled()) { $width = "device-width"; } else { $width = calibrefx_get_option('calibrefx_layout_width'); } echo '<meta name="viewport" content="width=' . $width . ', initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />' . "\n"; do_action('calibrefx_meta'); wp_head(); ?> </head> <body <?php body_onload(); ?> <?php body_class(); ?> <?php body_attr(); ?>