* @since Sweetdate 1.0 */ global $kleo_config; $kleo_config['image_sizes'] = array( 'blog_carousel' => array( 'width' => 310, 'height' => 177 ) ); // Profile fields to show on members loop, below the name $kleo_config['bp_members_loop_meta'] = array( 'I am a', 'Marital status', 'City' ); //From which profile field to show member details on members directory page $kleo_config['bp_members_details_field'] = 'About me'; /* * Arrays with compatibility match fields. Customize these fields to change the match score */ $kleo_config['matching_fields']['starting_score'] = 1; //If we want to match by members sex. values: 0|1 $kleo_config['matching_fields']['sex_match'] = 1; $kleo_config['matching_fields']['sex'] = 'I am a'; $kleo_config['matching_fields']['looking_for'] = 'Looking for a'; $kleo_config['matching_fields']['sex_percentage'] = 49; $kleo_config['matching_fields']['sex_mandatory'] = 1; //single value fields like select, textbox,radio $kleo_config['matching_fields']['single_value'] = array( 'Marital status' => 20, 'Country' => 10 ); //multiple values fields like multiple select or checkbox $kleo_config['matching_fields']['multiple_values'] = array( 'Interests' => 10, 'Looking for' => 10, ); /* Include theme constants */ require_once( get_template_directory() . '/framework/constants.php' ); /* Include our Framework logic */ require_once( FRAMEWORK_PATH . '/load.php' ); if ( ! isset( $content_width ) ) { $content_width = 980; } /** * Sets up theme defaults and registers the various WordPress features * * @uses load_theme_textdomain() For translation/localization support. * @uses add_editor_style() To add a Visual Editor stylesheet. * @uses add_theme_support() To add support for post thumbnails, automatic feed links, * custom background, and post formats. * @uses register_nav_menu() To add support for navigation menus. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since Sweetdate 1.0 */ function sweetdate_setup() { global $kleo_config; /* * Makes Sweetdate available for translation. * Translations can be added to the /languages/ directory. */ load_theme_textdomain( 'kleo_framework', get_template_directory() . '/languages' ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // Adds RSS feed links to for posts and comments. add_theme_support( 'automatic-feed-links' ); // This theme supports a variety of post formats. add_theme_support( 'structured-post-formats', array( 'link', 'video' ) ); add_theme_support( 'post-formats', array( 'aside', 'audio', 'gallery', 'image', 'quote', 'status', 'link', 'video' ) ); add_theme_support( 'bbpress' ); add_theme_support( 'woocommerce' ); add_theme_support( 'title-tag' ); // This theme uses wp_nav_menu() in one location. register_nav_menu( 'primary', __( 'Primary Menu', 'kleo_framework' ) ); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 938, 9999 ); // Unlimited height, soft crop add_image_size( 'blog_carousel', $kleo_config['image_sizes']['blog_carousel']['width'], $kleo_config['image_sizes']['blog_carousel']['height'], true ); // hard crop for articles carousel } add_action( 'after_setup_theme', 'sweetdate_setup', 8 ); if ( ! function_exists( '_wp_render_title_tag' ) ) { function kleo_slug_render_title() { ?> <?php wp_title( '|', true, 'right' ); ?> get_template_directory_uri() . "/assets/images/blank.png", 'ajaxurl' => get_bloginfo( 'url' ) . '/wp-admin/admin-ajax.php', 'mainColor' => sq_option( 'bp_header_secondary_color' ), 'bpMatchBg' => sq_option( 'bp_match_bg_color', '' ), 'bpMatchFg' => sq_option( 'bp_match_fg_color', '' ), 'tosAlert' => apply_filters( 'kleo_fb_tos_alert', __( "You must agree with the terms and conditions.", 'kleo_framework' ) ), 'loadingmessage' => ' ' . __( 'Sending info, please wait...', 'kleo_framework' ), ); if ( function_exists( 'bp_is_active' ) ) { $obj_array['totalMembers'] = bp_get_total_member_count(); } /* Deprecated - typo */ //$obj_array = apply_filters( 'kleo_sript_localize_array', $obj_array ); /* New filter */ $obj_array = apply_filters( 'kleo_script_localize_array', $obj_array ); wp_localize_script( 'app', 'kleoFramework', $obj_array ); $foundation_array = array( 'back' => __( "Back", 'kleo_framework' ) ); wp_localize_script( 'foundation', 'foundTranslated', $foundation_array ); /* Load CSS */ // Register the style like this for a theme: wp_register_style( 'foundation', get_template_directory_uri() . '/assets/styles/foundation-nonresponsive.min.css', array(), SQUEEN_THEME_VERSION, 'all' ); wp_register_style( 'foundation-responsive', get_template_directory_uri() . '/assets/styles/responsive' . $min . '.css', array(), SQUEEN_THEME_VERSION, 'all' ); //Plugins wp_register_style( 'sq-font-awesome', get_template_directory_uri() . '/assets/styles/font-awesome.min.css', array(), SQUEEN_THEME_VERSION, 'all' ); wp_register_style( 'prettyPhoto', get_template_directory_uri() . '/assets/styles/prettyPhoto' . $min . '.css', array(), SQUEEN_THEME_VERSION, 'all' ); //Mediaelement wp_register_style( 'mediaelement', get_template_directory_uri() . '/assets/scripts/plugins/mediaelement/build/mediaelementplayer' . $min . '.css', array(), SQUEEN_THEME_VERSION, 'all' ); //Main Stylesheet wp_register_style( 'app', get_template_directory_uri() . '/assets/styles/app'. $min .'.css', array(), SQUEEN_THEME_VERSION, 'all' ); wp_register_style( 'kleo-rtl', get_template_directory_uri() . '/rtl.css', array(), SQUEEN_THEME_VERSION, 'all' ); wp_register_style( 'sweet-style', get_stylesheet_directory_uri() . '/style.css', array(), SQUEEN_THEME_VERSION, 'all' ); //enque them wp_enqueue_style( 'foundation' ); wp_enqueue_style( 'sq-font-awesome' ); wp_enqueue_style( 'prettyPhoto' ); //main stylesheet wp_enqueue_style( 'app' ); //enable/disable responsive if ( sq_option( 'responsive_design' ) == 1 ) { wp_enqueue_style( 'foundation-responsive' ); } //enqueue child theme style only if activated if ( is_child_theme() ) { if ( is_rtl() ) { wp_enqueue_style( 'kleo-rtl' ); } } } add_action( 'wp_enqueue_scripts', 'sweet_load_css_files_plugin_compat', 1000 ); function sweet_load_css_files_plugin_compat() { //enqueue child theme style only if activated if ( is_child_theme() ) { wp_enqueue_style( 'sweet-style' ); } } // sweet_load_css_files_plugin_compat() /*************************************************** * Adds JavaScript to pages with the comment form * to support sites with threaded comments (when in use). ***************************************************/ function sweetdate_comment_script() { global $wp_styles; if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'sweetdate_comment_script' ); /*************************************************** * :: Render the header section with the menus ***************************************************/ function sweetdate_show_header() { get_template_part( 'page-parts/general-header' ); } add_action( 'sweetdate_header', 'sweetdate_show_header' ); /* Load the framework functions. */ add_action( 'after_setup_theme', 'kleo_framework_functions', 9 ); /** * Adds theme functionalities */ function kleo_framework_functions() { /* Include Buddypress functions */ if ( function_exists( 'bp_is_active' ) ) { locate_template( 'custom_buddypress/bp-functions.php', true ); } /* Include Woocommerce functions */ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { locate_template( 'lib/plugins/woocommerce/config.php', true ); } // Compatibility Bp Profile Search if ( defined( 'BPS_VERSION' ) ) { locate_template( 'lib/plugins/bp-profile-search/config.php', true ); } /* Paid memberships pro integration */ if ( function_exists( 'pmpro_url' ) ) { locate_template( 'lib/plugins/pmpro/config.php', true ); } /* Include our custom shortcodes for this theme */ locate_template( 'lib/shortcodes.php', true ); if ( defined( 'ELEMENTOR_PATH' ) ) { locate_template( 'lib/plugins/elementor/config.php', true ); } } if ( ! function_exists( '_wp_render_title_tag' ) ) { function kleo_slug_render_title() { ?> <?php wp_title( '|', true, 'right' ); ?> = 2 || $page >= 2 ) { $title = "$title $sep " . sprintf( __( 'Page %s', 'kleo_framework' ), max( $paged, $page ) ); } return $title; } if ( ! function_exists( '_wp_render_title_tag' ) ) { add_filter( 'wp_title', 'sweetdate_wp_title', 10, 2 ); } } if ( ! function_exists( 'sweetdate_main_nav' ) ) : /** * wp_nav_menu() callback from the main navigation in header.php * * Used when the custom menus haven't been configured. * * @param array $args arguments from wp_nav_menu() * * @see wp_nav_menu() * @since BuddyPress (1.5) */ function sweetdate_main_nav( $args ) { $pages_args = array( 'depth' => 0, 'echo' => false, 'exclude' => '', 'title_li' => '' ); $menu = wp_page_menu( $pages_args ); $menu = str_replace( array( '' ), array( '' ), $menu ); echo $menu; do_action( 'bp_nav_items' ); } endif; //------------------------------------------------------------------------------ /** * Modify some elements for the menu */ if ( ! class_exists( 'sweetdate_walker_nav_menu' ) ) : class sweetdate_walker_nav_menu extends Walker_Nav_Menu { // add classes to ul sub-menus function start_lvl( &$output, $depth = 0, $args = array() ) { // depth dependent classes $indent = ( $depth > 0 ? str_repeat( "\t", $depth ) : '' ); // code indent $display_depth = ( $depth + 1 ); // because it counts the first submenu as 0 $classes = array( 'dropdown' ); $class_names = implode( ' ', $classes ); // build html $output .= "\n" . $indent . '