'Grid Masonry',
'small' => 'Small Left Thumbnail',
'standard' => 'Standard'
);
$kleo_config['blog_meta_elements'] = array(
'avatar' => 'Author Avatar',
'date' => 'Date',
'archive' => 'Archive Link',
'profile' => 'Profile Icon',
'author_link' => 'Profile Link',
'message' => 'Message Link',
'categories' => 'Categories',
'tags' => 'Tags',
'comments' => 'Comments'
);
$kleo_config['blog_meta_defaults'] = array('author_link', 'date', 'categories', 'tags', 'comments');
//define dynamic styles path
$upload_dir = wp_upload_dir();
if ( is_ssl() ) {
if ( strpos( $upload_dir['baseurl'], 'https://' ) === false) {
$upload_dir['baseurl'] = str_ireplace('http', 'https', $upload_dir['baseurl']);
}
}
$kleo_config['upload_basedir'] = $upload_dir['basedir'];
$kleo_config['custom_style_path'] = $upload_dir['basedir'] . '/custom_styles';
$kleo_config['custom_style_url'] = $upload_dir['baseurl'] . '/custom_styles';
$kleo_config['image_overlay'] = '+';
//define site style sets
$kleo_config['style_sets'] = array( 'header','main','alternate','side','footer','socket');
$kleo_config['font_sections'] = array('h1','h2','h3','h4','h5','h6','body');
//physical file template mapping
$kleo_config['tpl_map'] = array(
'page-templates/left-sidebar.php' => 'left',
'page-templates/right-sidebar.php' => 'right',
'page-templates/full-width.php' => 'no',
'page-templates/left-right-sidebars.php' => '3lr',
'page-templates/left-two-sidebars.php' => '3ll',
'page-templates/right-two-sidebars.php' => '3rr'
);
/***************************************************
:: Framework initialization with required plugins
***************************************************/
//instance of our theme framework
global $kleo_theme;
/**
* @return Kleo
*/
function sq_kleo() {
return Kleo::instance();
}
$kleo_theme = sq_kleo();
if ( is_admin() ) {
require_once KLEO_LIB_DIR . '/required-plugins.php';
}
/***************************************************
:: Load Theme functions
***************************************************/
add_action( 'after_setup_theme', 'kleo_theme_functions', 12 );
function kleo_theme_functions() {
/* Plugins and functionality */
// BuddyPress compatibility
if (function_exists( 'bp_is_active' )) {
require_once( KLEO_LIB_DIR . '/plugin-buddypress/config.php' ); //compatibility with buddypress plugin
}
// bbPress compatibility
if (class_exists( 'bbPress' )) {
require_once( KLEO_LIB_DIR . '/plugin-bbpress/config.php' ); //compatibility with bbpress plugin
}
/* Woocommerce compatibility */
if ( class_exists( 'WooCommerce' ) ) {
require_once( KLEO_LIB_DIR . '/plugin-woocommerce/config.php' );
}
// Paid memberships Pro compatibility
if(function_exists('pmpro_url')) {
require_once( KLEO_LIB_DIR . '/plugin-pmpro/config.php' );
}
// Visual composer compatibility
if( function_exists( 'vc_set_as_theme' ) ) {
require_once( KLEO_LIB_DIR . '/plugin-vc/config.php' );
}
// Compatibility with GeoDirectory plugin
if( defined( 'GEODIRECTORY_VERSION' ) ) {
require_once( KLEO_LIB_DIR . '/plugin-geodirectory/config.php' );
}
// Compatibility with Sensei plugin
if( class_exists( 'WooThemes_Sensei' ) ) {
require_once( KLEO_LIB_DIR . '/plugin-sensei/config.php' );
}
// Compatibility Bp Profile Search
if( defined( 'BPS_VERSION' ) ) {
require_once( KLEO_LIB_DIR . '/plugin-bp-profile-search/config.php' );
}
// Posts likes
if (sq_option('likes_status', 1) == 1) {
require_once( KLEO_LIB_DIR . '/item-likes.php' );
}
// Resize on the fly
require_once(KLEO_LIB_DIR . '/aq_resizer.php');
// menu-items-visibility-control plugin compatibility
if ( class_exists('Boom_Walker_Nav_Menu_Edit') ) {
require_once(KLEO_LIB_DIR . '/plugin-menu-items-visibility-control/config.php');
}
/* Custom menu */
require_if_theme_supports( 'kleo-mega-menu', KLEO_LIB_DIR . '/menu-custom.php');
/* Custom menu items */
require_if_theme_supports( 'kleo-menu-items', KLEO_LIB_DIR . '/menu-items.php');
/* Portfolio module */
if ( sq_option( 'module_portfolio', 1 ) == 1 ) {
require KLEO_LIB_DIR . '/portfolio.php';
}
/* Include admin customizations */
if ( is_admin() ) {
//Metaboxes
require_once(KLEO_LIB_DIR . '/metaboxes.php');
}
if (is_admin() || is_customize_preview()) {
require_once(KLEO_LIB_DIR . '/options.php');
}
//Modules
require_once( KLEO_LIB_DIR . '/modules.php' );
}
/***************************************************
:: Theme panel
***************************************************/
if ( is_admin() ) {
require_once( KLEO_LIB_DIR . '/theme-panel/init.php' );
}
/***************************************************
:: 1 Click Install
***************************************************/
if ( is_admin() ) {
require_once( KLEO_LIB_DIR . '/importer/import.php' );
}
/***************************************************
:: Load post types class
***************************************************/
require_once KLEO_LIB_DIR. '/post-types.php';
/* Testimonials module */
if ( sq_option( 'module_testimonials', 1 ) == 1 ) {
require KLEO_LIB_DIR . '/testimonials.php';
}
/* Clients module */
if ( sq_option( 'module_clients', 1 ) == 1 ) {
require KLEO_LIB_DIR . '/clients.php';
}
/***************************************************
:: Theme options
***************************************************/
if ( is_admin() || is_customize_preview() ) {
//Options panel
if (!class_exists('ReduxFramework') && file_exists(KLEO_DIR . '/options/framework.php')) {
require_once(KLEO_DIR . '/options/framework.php');
}
}
/***************************************************
:: Modules Class
***************************************************/
if ( sq_option( 'performance', 0 ) == 1 ) {
require_once( KLEO_DIR . '/modules.php' );
}
/***************************************************
:: Include widgets
***************************************************/
$kleo_widgets = array(
'recent_posts.php'
);
$kleo_widgets = apply_filters( 'kleo_widgets', $kleo_widgets );
foreach ( $kleo_widgets as $widget ) {
$file_path = trailingslashit( KLEO_LIB_DIR ) . 'widgets/' . $widget;
if ( file_exists( $file_path ) ) {
require_once( $file_path );
}
}
/**
* Return the breadcrumb area
* @global object $wp_query
* @param array $args
* @return string
*/
function kleo_title_section($args = false)
{
$defaults = array(
'title' => get_the_title(),
'show_title' => true,
'show_breadcrumb' => true,
'link' => '',
'output' => "
' . do_shortcode( sq_option( 'title_info', '' ) ) . '
', 'heading' => 'h1' ); // Parse incoming $args into an array and merge it with $defaults $args = wp_parse_args( $args, $defaults ); $args = apply_filters('kleo_title_args', $args); // OPTIONAL: Declare each item in $args as its own variable i.e. $type, $before. extract( $args, EXTR_SKIP ); if(!empty($link)) { $title = "".$title.""; } $breadcrumb_data = ''; if( $show_breadcrumb ) { $breadcrumb_data = kleo_breadcrumb(array( 'show_browse' => false, 'separator' => ' ', 'show_home' => __( 'Home', 'kleo_framework' ), 'echo' => false )); } $title_data = ''; if( $show_title ) { $title_data = '<{heading} class="page-title">{title}{heading}>'; } if ( ! $show_breadcrumb && $extra == '' ) { $class .= ' title-single'; } $title_layout = sq_option( 'title_layout', 'normal' ); if (is_singular() && get_cfield('title_layout') && get_cfield('title_layout') != '' ) { $title_layout = get_cfield('title_layout'); } if ( $title_layout == 'center' ) { $class .= ' main-center-title'; } elseif( $title_layout == 'right_breadcrumb' ) { $class .= ' main-right-breadcrumb'; } $output = str_replace('{title_data}', $title_data, $output); $output = str_replace('{class}', $class, $output); $output = str_replace('{title}', $title, $output); $output = str_replace('{breadcrumb_data}', $breadcrumb_data, $output); $output = str_replace('{extra}', $extra, $output); $output = str_replace('{heading}', $heading, $output); return $output; } /** * Prepare the title/breadcrumb area using hide/show site options * @param integer $post_id * @return array */ function kleo_prepare_title( $post_id = null ) { $title_arr = array(); $title_arr['title'] = kleo_title(); //hide title? $title_arr['show_title'] = true; if( get_cfield( 'title_checkbox', $post_id ) == 1 ) { $title_arr['show_title'] = false; } if ( sq_option('title_location', 'breadcrumb') == 'main' ) { $title_arr['show_title'] = false; } //hide breadcrumb? $title_arr['show_breadcrumb'] = true; if(sq_option('breadcrumb_status', 1) == 0) { $title_arr['show_breadcrumb'] = false; } if(get_cfield( 'hide_breadcrumb', $post_id ) == 1) { $title_arr['show_breadcrumb'] = false; } else if ( get_cfield( 'hide_breadcrumb', $post_id ) === '0' ) { $title_arr['show_breadcrumb'] = true; } //hide extra info? if(get_cfield( 'hide_info' , $post_id ) == 1) { $title_arr['extra'] = ''; } return $title_arr; } /*************************************************** * TOP TOOLBAR - ADMIN BAR * Enable or disable the bar, depending of the theme option setting ***************************************************/ if (sq_option('admin_bar', 1) == '0'): remove_action('wp_footer','wp_admin_bar_render',1000); add_filter('show_admin_bar', '__return_false'); endif; /*************************************************** :: MAINTENANCE MODE ***************************************************/ if (!function_exists('kleo_maintenance_mode')) { function kleo_maintenance_mode() { $logo_path = apply_filters('kleo_logo', sq_option_url('logo')); $logo_img = '