/** * * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 * */ function kopa_options_contact() { $groups['info'] = array('icon' => '', 'title' => __('Contact Infomation', kopa_get_domain()), 'fields' => array()); $groups['info']['fields'][] = array('type' => 'text', 'id' => 'contact_info_caption', 'name' => 'contact_info_caption', 'label' => __('Caption', kopa_get_domain()), 'help' => '', 'classes' => array('linedtextarea'), 'default' => __('Contact information', kopa_get_domain())); $groups['info']['fields'][] = array('type' => 'textarea', 'id' => 'contact_info_description', 'name' => 'contact_info_description', 'label' => __('Descripton', kopa_get_domain()), 'help' => '', 'classes' => array('linedtextarea'), 'attributes' => array('rows' => 10), 'default' => ''); $groups['info']['fields'][] = array('type' => 'text', 'id' => 'contact_phone', 'name' => 'contact_phone', 'label' => __('Phone number', kopa_get_domain()), 'default' => ''); $groups['info']['fields'][] = array('type' => 'text', 'id' => 'contact_fax', 'name' => 'contact_fax', 'label' => __('Fax number', kopa_get_domain()), 'default' => ''); $groups['info']['fields'][] = array('type' => 'text', 'id' => 'contact_email', 'name' => 'contact_email', 'label' => __('Email(s)', kopa_get_domain()), 'default' => ''); $groups['info']['fields'][] = array('type' => 'text', 'id' => 'contact_address', 'name' => 'contact_address', 'label' => __('Address', kopa_get_domain()), 'default' => ''); $groups['info']['fields'][] = array('type' => 'text', 'id' => 'contact_map', 'name' => 'contact_map', 'label' => __('Google Map', kopa_get_domain()), 'help' => sprintf('Enter your google map code <code>latitude,longitude</code>. Example: <code>40.722868,-73.99739</code>. %s <a target="_blank" href="https://db.tt/p77FqjZC">%s</a>.', __('How to get it? Click', kopa_get_domain()), __('here', kopa_get_domain())), 'default' => '40.722868,-73.99739'); $groups['info']['fields'][] = array('type' => 'media', 'id' => 'contact_map_marker', 'name' => 'contact_map_marker', 'label' => __('Gmap Marker', kopa_get_domain()), 'help' => __('You can download, and edit marker image from PSD file. Download <a href="https://db.tt/qssyQ4pY" target="_blank">here</a>', kopa_get_domain()), 'default' => get_template_directory_uri() . '/images/marker.png'); /* * -------------------------------------------------- * CONTACT FORM * -------------------------------------------------- */ $groups['form'] = array('icon' => '', 'title' => __('Contact Form', kopa_get_domain()), 'fields' => array()); $groups['form']['fields'][] = array('type' => 'text', 'id' => 'contact_form_caption', 'name' => 'contact_form_caption', 'label' => __('Caption', kopa_get_domain()), 'help' => '', 'classes' => array('linedtextarea'), 'default' => __('Contact form', kopa_get_domain())); $groups['form']['fields'][] = array('type' => 'textarea', 'id' => 'contact_form_description', 'name' => 'contact_form_description', 'label' => __('Descripton', kopa_get_domain()), 'help' => '', 'classes' => array('linedtextarea'), 'attributes' => array('rows' => 10), 'default' => ''); $groups['form']['fields'][] = array('type' => 'group', 'id' => 'recaptcha', 'name' => 'recaptcha', 'label' => __('reCaptcha', kopa_get_domain()), 'default' => '', 'sub_fields' => array(array('type' => 'select', 'id' => 'recaptcha_skin', 'name' => 'recaptcha_skin', 'label' => __('<code>SKIN</code>', kopa_get_domain()), 'help' => __('To view skins preview, click <a target="_blank" href="https://db.tt/cYvusoxp">here</a>.<br/>To create your public & private key, click <a target="_blank" href="http://www.google.com/recaptcha/whyrecaptcha">here</a>', kopa_get_domain()), 'default' => 'clean', 'value' => KopaOptions::get_option('recaptcha_skin', 'clean'), 'options' => array('off' => __('-- Hide --', kopa_get_domain()), 'clean' => __('Clean', kopa_get_domain()), 'red' => __('Red', kopa_get_domain()), 'white' => __('White', kopa_get_domain()), 'blackglass' => __('Black glass', kopa_get_domain())), 'classes' => array('kopa_sub_field_control', 'kopa_recaptcha_skin'), 'wrap_begin' => '<div class="kopa_sub_field_wrap">', 'wrap_end' => '</div>', 'label_begin' => '<div>', 'label_end' => '</div>', 'attributes' => array('onchange' => 'KopaThemeOptions.onChangeReCaptchaSkin(event, jQuery(this));')), array('type' => 'text', 'id' => 'recaptcha_public_key', 'name' => 'recaptcha_public_key', 'value' => KopaOptions::get_option('recaptcha_public_key'), 'default' => '6Lc6ou4SAAAAAF2yR3zRLTSljpTCPpdFRqWD5wXt', 'label' => __('<code>PUBLIC KEY</code>', kopa_get_domain()), 'classes' => array('kopa_sub_field_control'), 'wrap_begin' => '<div class="kopa_sub_field_wrap">', 'wrap_end' => '</div>'), array('type' => 'text', 'id' => 'recaptcha_private_key', 'name' => 'recaptcha_private_key', 'value' => KopaOptions::get_option('recaptcha_private_key'), 'default' => '6Lc6ou4SAAAAAO1_5edZqUythRWLGxgHGyDTYRUJ', 'label' => __('<code>PRIVATE KEY</code>', kopa_get_domain()), 'classes' => array('kopa_sub_field_control'), 'wrap_begin' => '<div class="kopa_sub_field_wrap">', 'wrap_end' => '</div>'))); $groups['form']['fields'][] = array('type' => 'textarea', 'id' => 'contact_reply_template', 'name' => 'contact_reply_template', 'label' => __('Mail Reply Template', kopa_get_domain()), 'help' => 'Variable: <code>[contact_name]</code>, <code>[contact_email]</code>, <code>[contact_message]</code>', 'classes' => array('linedtextarea'), 'attributes' => array('rows' => 10), 'default' => '<p>Aloha!</p> <p>You have a new message from [contact_name] ([contact_email])</p> <div>[contact_message]</div> <p>Thanks!</p>'); return apply_filters('kopa_options_contact', $groups); }
/** * * * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 * */ public static function get_title() { $title = ''; $pattern = ''; if (is_main_query() && 'true' == KopaOptions::get_option('seo_status', 'true')) { $pattern = '[site_name] - [site_desc]'; if (is_archive()) { if (is_tag() || is_category()) { $pattern = KopaOptions::get_option('seo_title_taxonomy', '[term_type] - [term_name] - [pagination_paged] - [site_name]'); } else { if (is_author()) { $pattern = KopaOptions::get_option('seo_title_author', 'Posts created by [author_name] - [site_name]'); } } } else { if (is_search()) { $pattern = KopaOptions::get_option('seo_title_search', 'Search pages: You searched for [search_phrase] return [search_result_count] results - [site_name]'); } else { if (is_singular()) { if (is_page()) { $pattern = KopaOptions::get_option('seo_title_page', '[page_name] - [site_name]'); if (is_front_page()) { $pattern = KopaOptions::get_option('seo_title_front_page', '[site_name] - [site_desc]'); } } else { if (is_single()) { $pattern = KopaOptions::get_option('seo_title_post', '[post_name] - Created by [post_author_name] - In category: [post_cats] - Tagged with: [post_tags] - [site_name] - [site_desc]'); } } } else { if (is_404()) { $pattern = KopaOptions::get_option('seo_title_404', 'Oops! 404 Page not found - [site_name] - [site_desc]'); } else { if (is_home()) { $pattern = KopaOptions::get_option('seo_title_home_page', 'Latest News - [pagination_paged] - [site_name] - [site_desc]'); } } } } } } if (empty($pattern)) { global $page, $paged; $title = wp_title('|', FALSE, 'right'); $title .= get_bloginfo('name'); $site_description = get_bloginfo('description', 'display'); if ($site_description && (is_home() || is_front_page())) { $title .= " | {$site_description}"; } if ($paged >= 2 || $page >= 2) { $title .= ' | ' . sprintf(__('Page %s', kopa_get_domain()), max($paged, $page)); } } else { $title = do_shortcode($pattern); } return apply_filters('kopa_seo_get_title', $title); }
/** * * * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 * */ public static function detect_image_size($size) { if ($size && 'true' == KopaOptions::get_option('is_use_mobile_detect', 'false')) { $detect = new Mobile_Detect(); if ($detect->isMobile()) { } if ($detect->isTablet()) { } } return apply_filters('kopa_image_detect_image_size', $size); }
/** * * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 * */ function kopa_options_blog_posts() { $groups['archive'] = array('icon' => '', 'title' => __('Blog post', kopa_get_domain()), 'fields' => array()); $groups['archive']['fields'][] = array('type' => 'radio-list', 'id' => 'exceprt_type', 'name' => 'exceprt_type', 'label' => __('For each article in list, show', kopa_get_domain()), 'default' => 'excerpt', 'help' => '', 'options' => array(array('value' => 'excerpt', 'label' => __('Excerpt', kopa_get_domain())), array('value' => 'full', 'label' => __('Full content', kopa_get_domain())), array('value' => 'limit', 'label' => __('Limit number characters', kopa_get_domain()), 'sub_fields' => array(array('type' => 'number', 'id' => 'excerpt_limit', 'name' => 'excerpt_limit', 'default' => 200, 'value' => KopaOptions::get_option('excerpt_limit', 200))))), 'option_args' => array('wrap_begin' => '<div class="row cleafix"><div class="col-xs-12">', 'wrap_end' => '</div></div>', 'label_begin' => '', 'label_end' => '', 'control_begin' => '', 'control_end' => '')); $groups['archive']['fields'][] = array('type' => 'radio-truefalse', 'id' => 'is_display_blog_post_format', 'name' => 'is_display_blog_post_format', 'value' => 'false', 'default' => 'false', 'label' => __('Display content formatted', kopa_get_domain()), 'help_classes' => '', 'help' => __('If value is <code>Yes</code>, thumbnails has been replaced by video, audio or gallery shortcode', kopa_get_domain()), 'true' => __('Yes', kopa_get_domain()), 'false' => __('No', kopa_get_domain())); $groups['archive']['fields'][] = array('type' => 'radio-truefalse', 'id' => 'is_display_created_date', 'name' => 'is_display_created_date', 'value' => 'true', 'default' => 'true', 'label' => __('Created Date', kopa_get_domain()), 'help_classes' => array(), 'true' => __('Show', kopa_get_domain()), 'false' => __('Hide', kopa_get_domain())); $groups['archive']['fields'][] = array('type' => 'radio-truefalse', 'id' => 'is_display_comments', 'name' => 'is_display_comments', 'value' => 'true', 'default' => 'true', 'label' => __('Number of comments', kopa_get_domain()), 'help_classes' => array(), 'true' => __('Show', kopa_get_domain()), 'false' => __('Hide', kopa_get_domain())); $groups['archive']['fields'][] = array('type' => 'radio-truefalse', 'id' => 'is_display_views', 'name' => 'is_display_views', 'value' => 'true', 'default' => 'true', 'label' => __('Number of views', kopa_get_domain()), 'help_classes' => array(), 'true' => __('Show', kopa_get_domain()), 'false' => __('Hide', kopa_get_domain())); $groups['archive']['fields'][] = array('type' => 'radio-truefalse', 'id' => 'is_display_likes', 'name' => 'is_display_likes', 'value' => 'true', 'default' => 'true', 'label' => __('Number of likes', kopa_get_domain()), 'help_classes' => array(), 'true' => __('Show', kopa_get_domain()), 'false' => __('Hide', kopa_get_domain())); $groups['archive']['fields'][] = array('type' => 'radio-truefalse', 'id' => 'is_display_readmore', 'name' => 'is_display_readmore', 'value' => 'true', 'default' => 'true', 'label' => __('Read more button', kopa_get_domain()), 'help_classes' => array(), 'true' => __('Show', kopa_get_domain()), 'false' => __('Hide', kopa_get_domain())); return apply_filters('kopa_options_blog_posts', $groups); }
/** * * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 * */ function kopa_options_seo() { /* * SEO * **************************** */ $groups['seo'] = array('icon' => '', 'title' => __('SEO - Search engine optimization', kopa_get_domain()), 'fields' => array()); $groups['seo']['fields'][] = array('type' => 'radio-truefalse', 'id' => 'seo_status', 'name' => 'seo_status', 'value' => 'true', 'default' => 'true', 'label' => __('Status', kopa_get_domain()), 'help' => __('If you using any SEO Plugin, please disable this option.', kopa_get_domain()), 'true' => __('Enable', kopa_get_domain()), 'false' => __('Disable', kopa_get_domain()), 'attributes' => array('onclick' => 'KopaThemeOptions.onClickSEOStatus(event, jQuery(this));'), 'option_args' => array('classes' => array('rdo_seo_status'))); $seo_keys = array(); $seo_keys['site_name'] = __('Your site name', kopa_get_domain()); $seo_keys['site_desc'] = __('Your site description', kopa_get_domain()); $seo_keys['term_type'] = __('Type of term. E.g. category, post_tag', kopa_get_domain()); $seo_keys['term_name'] = __('Name of category or tag', kopa_get_domain()); $seo_keys['pagination_paged'] = __('Number of current page', kopa_get_domain()); $seo_keys['page_name'] = __('Name of current page', kopa_get_domain()); $seo_keys['post_name'] = __('Name of current post', kopa_get_domain()); $seo_keys['post_author_name'] = __('Author of current post(page)', kopa_get_domain()); $seo_keys['post_cats'] = __('Categories of current post', kopa_get_domain()); $seo_keys['post_tags'] = __('Tags of current post', kopa_get_domain()); $seo_keys['author_name'] = __('Name of current author (author page)', kopa_get_domain()); $seo_keys['search_phrase'] = __('Search keyword', kopa_get_domain()); $seo_keys['search_result_count'] = __('Number of search results', kopa_get_domain()); $seo_keys_help = array(); foreach ($seo_keys as $key => $desc) { $seo_keys_help[] = sprintf('<span class="kopa_seo_title_key"><code>[%s]</code></span>%s', $key, $desc); } $groups['seo']['fields'][] = array('type' => 'group', 'id' => 'seo_titles', 'name' => 'seo_titles', 'label' => __('Title', kopa_get_domain()), 'default' => '', 'help' => implode('<br/>', $seo_keys_help), 'sub_fields' => array(array('type' => 'text', 'id' => 'seo_title_front_page', 'name' => 'seo_title_front_page', 'value' => KopaOptions::get_option('seo_title_front_page', '[site_name] - [site_desc]'), 'default' => '[site_name] - [site_desc]', 'label' => __('<code>HOME</code>', kopa_get_domain()), 'classes' => array('kopa_sub_field_control'), 'wrap_begin' => '<div class="kopa_sub_field_wrap">', 'wrap_end' => '</div>', 'help' => __('Front Page (it\'s static page)', kopa_get_domain())), array('type' => 'text', 'id' => 'seo_title_home_page', 'name' => 'seo_title_home_page', 'value' => KopaOptions::get_option('seo_title_home_page', 'Latest News - [pagination_paged] - [site_name] - [site_desc]'), 'default' => 'Latest News - [pagination_paged] - [site_name] - [site_desc]', 'label' => __('<code>HOME</code>', kopa_get_domain()), 'classes' => array('kopa_sub_field_control'), 'wrap_begin' => '<div class="kopa_sub_field_wrap">', 'wrap_end' => '</div>', 'help' => __('Blog posts (display latest posts with pagination)', kopa_get_domain())), array('type' => 'text', 'id' => 'seo_title_taxonomy', 'name' => 'seo_title_taxonomy', 'value' => KopaOptions::get_option('seo_title_taxonomy', '[term_type] - [term_name] - [pagination_paged] - [site_name]- [site_desc]'), 'default' => '[term_type] - [term_name] - [pagination_paged] - [site_name] - [site_desc]', 'label' => __('<code>TAXONOMY</code>', kopa_get_domain()), 'classes' => array('kopa_sub_field_control'), 'wrap_begin' => '<div class="kopa_sub_field_wrap">', 'wrap_end' => '</div>', 'help' => __('Category or Tag (taxonomy - display post lists with pagination)', kopa_get_domain())), array('type' => 'text', 'id' => 'seo_title_page', 'name' => 'seo_title_page', 'value' => KopaOptions::get_option('seo_title_page', '[page_name] - [site_name] - [site_desc]'), 'default' => '[page_name] - [site_name] - [site_desc]', 'label' => __('<code>PAGE</code>', kopa_get_domain()), 'classes' => array('kopa_sub_field_control'), 'wrap_begin' => '<div class="kopa_sub_field_wrap">', 'wrap_end' => '</div>', 'help' => __('Static Page', kopa_get_domain())), array('type' => 'text', 'id' => 'seo_title_post', 'name' => 'seo_title_post', 'value' => KopaOptions::get_option('seo_title_post', '[post_name] - Created by [post_author_name] - In category: [post_cats] - Tagged with: [post_tags] - [site_name] - [site_desc]'), 'default' => '[post_name] - Created by [post_author_name] - In category: [post_cats] - Tagged with: [post_tags] - [site_name] - [site_desc]', 'label' => __('<code>POST</code>', kopa_get_domain()), 'classes' => array('kopa_sub_field_control'), 'wrap_begin' => '<div class="kopa_sub_field_wrap">', 'wrap_end' => '</div>', 'help' => __('Single Post (article)', kopa_get_domain())), array('type' => 'text', 'id' => 'seo_title_author', 'name' => 'seo_title_author', 'value' => KopaOptions::get_option('seo_title_author', 'Posts created by [author_name] - [site_name] - [site_desc]'), 'default' => 'Posts created by [author_name] - [site_name] - [site_desc]', 'label' => __('<code>AUTHOR</code>', kopa_get_domain()), 'classes' => array('kopa_sub_field_control'), 'wrap_begin' => '<div class="kopa_sub_field_wrap">', 'wrap_end' => '</div>', 'help' => __('Author Page (display all posts created by an author)', kopa_get_domain())), array('type' => 'text', 'id' => 'seo_title_search', 'name' => 'seo_title_search', 'value' => KopaOptions::get_option('seo_title_search', 'Search pages: You searched for [search_phrase] return [search_result_count] results - [site_name] - [site_desc]'), 'default' => 'Search pages: You searched for [search_phrase] return [search_result_count] results - [site_name] - [site_desc]', 'label' => __('<code>SEARCH</code>', kopa_get_domain()), 'classes' => array('kopa_sub_field_control'), 'wrap_begin' => '<div class="kopa_sub_field_wrap">', 'wrap_end' => '</div>', 'help' => __('Search Page', kopa_get_domain())), array('type' => 'text', 'id' => 'seo_title_404', 'name' => 'seo_title_404', 'value' => KopaOptions::get_option('seo_title_404', 'Oops! 404 Page not found - [site_name] - [site_desc]'), 'default' => 'Oops! 404 Page not found - [site_name] - [site_desc]', 'label' => __('<code>404</code>', kopa_get_domain()), 'classes' => array('kopa_sub_field_control'), 'wrap_begin' => '<div class="kopa_sub_field_wrap">', 'wrap_end' => '</div>', 'help' => __('Page not found', kopa_get_domain())))); $groups['seo']['fields'][] = array('type' => 'textarea', 'id' => 'seo_keywords', 'name' => 'seo_keywords', 'label' => __('Keywords', kopa_get_domain()), 'help' => __('Enter your website keyword(s), separated by comma.<br/>This is global keywords, for each post, page, category, tag,.. you can manual append other keyword.', kopa_get_domain()), 'classes' => array('linedtextarea'), 'attributes' => array('rows' => 4), 'default' => ''); $groups['seo']['fields'][] = array('type' => 'textarea', 'id' => 'seo_descriptions', 'name' => 'seo_descriptions', 'label' => __('Description', kopa_get_domain()), 'help' => __('Enter your website description.<br/>This is global description, It will be replace by manual description from post, page, category, tag,..', kopa_get_domain()), 'classes' => array('linedtextarea'), 'attributes' => array('rows' => 4), 'default' => ''); $groups['seo']['fields'][] = array('type' => 'media', 'id' => 'seo_facebook_og_image', 'name' => 'seo_facebook_og_image', 'label' => __('Facebook Open Graph Image', kopa_get_domain()), 'help' => '<meta property="og:image" content="<code>YOUR IMAGE URL</code>">.' . __('<br/>It\'s default value for "og:image."', kopa_get_domain()), 'default' => ''); $groups['seo']['fields'][] = array('type' => 'text', 'id' => 'seo_facebook_og_type', 'name' => 'seo_facebook_og_type', 'label' => __('Facebook Open Graph Type', kopa_get_domain()), 'help' => '<meta property="og:type" content="<code>website</code>">.' . __('<br/>Enter your custom object type OR set default value is "website"."', kopa_get_domain()), 'default' => 'website'); $groups['seo']['fields'][] = array('type' => 'text', 'id' => 'seo_facebook_page_id', 'name' => 'seo_facebook_page_id', 'label' => __('Facebook Page ID', kopa_get_domain()), 'help' => '<meta property="fb:page_id" content="<code>1234567890</code>">', 'default' => ''); $groups['seo']['fields'][] = array('type' => 'text', 'id' => 'seo_facebook_app_id', 'name' => 'seo_facebook_app_id', 'label' => __('Facebook App ID', kopa_get_domain()), 'help' => '<meta property="fb:app_id" content="<code>1234567890</code>">', 'default' => ''); $groups['seo']['fields'][] = array('type' => 'text', 'id' => 'seo_facebook_admins', 'name' => 'seo_facebook_admins', 'label' => __('Facebook Admins', kopa_get_domain()), 'help' => '<meta property="fb:admins" content="<code>123,456,789</code>">', 'default' => ''); $groups['seo']['fields'][] = array('type' => 'text', 'id' => 'seo_google_profile_url', 'name' => 'seo_google_profile_url', 'label' => __('Google profile', kopa_get_domain()), 'help' => '<link rel="author" href="<code>https://plus.google.com/1234567890</code>"><br/>' . sprintf(__('<a href="%s" target="_blank">Link to your Google+ profile using rel="author"</a>.', kopa_get_domain()), 'https://plus.google.com/authorship'), 'default' => ''); $groups['seo']['fields'][] = array('type' => 'text', 'id' => 'seo_twitter_name', 'name' => 'seo_twitter_name', 'label' => __('Twitter cards', kopa_get_domain()), 'help' => __('Please enter your twitter name with format <code>@your_name</code>', kopa_get_domain()), 'default' => ''); /* * GOOGLE ANALYTICS * **************************** */ $groups['analytics'] = array('icon' => '', 'title' => __('Google analytics', kopa_get_domain()), 'fields' => array()); $groups['analytics']['fields'][] = array('type' => 'textarea', 'id' => 'tracking_code', 'name' => 'tracking_code', 'label' => NULL, 'help' => __('Enter <a href="http://www.google.com/analytics/" target="_blank">Google Analytics</a> code. This should be something like: <code><script type="text/javascript"> ... </script></code>', kopa_get_domain()), 'default' => '', 'classes' => array('linedtextarea'), 'attributes' => array('rows' => 10), 'control_begin' => '<div class="col-md-12">', 'control_end' => '</div>', 'help_begin' => '<div class="col-md-12">', 'help_end' => '</div>'); /* * WEBSITE VERIFICATION SERVICES * **************************** */ $groups['verification-services'] = array('icon' => '', 'title' => __('Website Verification Services', kopa_get_domain()), 'fields' => array()); $groups['verification-services']['fields'][] = array('type' => 'text', 'id' => 'google_verify_meta', 'name' => 'google_verify_meta', 'label' => __('Google Webmaster Tools', kopa_get_domain()), 'default' => '', 'help' => sprintf(__('Enter your meta key "content" value to verify your website with <a target="_blank" href="https://www.google.com/webmasters/tools/">Google Webmaster Tools</a>.<br/>Example:<br/>%s', kopa_get_domain()), '<meta name="google-site-verification" content="<code>dBw5CvburAxi537Rp9qi5uG2174Vb6JwHwIRwPSLIK8</code>">')); $groups['verification-services']['fields'][] = array('type' => 'text', 'id' => 'bing_verify_meta', 'name' => 'bing_verify_meta', 'label' => __('Bing Webmaster Center', kopa_get_domain()), 'default' => '', 'help' => sprintf(__('Enter your meta key "content" value to verify your website with <a target="_blank" href="http://www.bing.com/webmaster/">Bing Webmaster Center</a>.<br/>Example:<br/>%s', kopa_get_domain()), '<meta name="msvalidate.01" content="<code>12C1203B5086AECE94EB3A3D9830B2E</code>">')); $groups['verification-services']['fields'][] = array('type' => 'text', 'id' => 'pinterest_verify_meta', 'name' => 'pinterest_verify_meta', 'label' => __('Pinterest Site Verification', kopa_get_domain()), 'default' => '', 'help' => sprintf(__('Enter your meta key "content" value to verify your website with <a target="_blank" href="https://pinterest.com/website/verify/">Pinterest Site Verification</a>.<br/>Example:<br/>%s', kopa_get_domain()), '<meta name="p:domain_verify" content="<code>f100679e6048d45e4a0b0b92dce1efce</code>">')); $groups['verification-services']['fields'][] = array('type' => 'text', 'id' => 'yandex_verify_meta', 'name' => 'yandex_verify_meta', 'label' => __('Yandex Webmaster', kopa_get_domain()), 'default' => '', 'help' => sprintf(__('Enter your meta key "content" value to verify your website with <a target="_blank" href="https://webmaster.yandex.com/sites/">Yandex Webmaster</a>.<br/>Example:<br/>%s', kopa_get_domain()), '<meta name="yandex-verification" content="<code>44d68e1216009f40</code>">')); return apply_filters('kopa_options_seo', $groups); }
public function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); echo $before_widget; if (!empty($title)) { echo $before_title . $title . $after_title; } echo '<div class="textwidget">'; echo empty($instance['description']) ? '' : "<p class='first'>{$instance['description']}</p>"; $address = KopaOptions::get_option('contact_address', false); echo !$address ? '' : '<p><span>' . __('Add:', kopa_get_domain()) . '</span> ' . $address . '</p>'; $fax = KopaOptions::get_option('contact_fax', false); echo !$fax ? '' : '<p><span>' . __('Fax:', kopa_get_domain()) . '</span> ' . $fax . '</p>'; $mobile = KopaOptions::get_option('contact_phone', false); echo !$mobile ? '' : '<p><span>' . __('Mobile:', kopa_get_domain()) . '</span> ' . $mobile . '</p>'; $email = KopaOptions::get_option('contact_email', false); echo !$email ? '' : '<p><span>' . __('Email:', kopa_get_domain()) . '</span> ' . $email . '</p>'; echo '</div>'; echo $after_widget; }
/** * * * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 * */ public static function get_pre_next_post() { $data = array(); $is_in_same_cat = 'true' == KopaOptions::get_option('is_display_post_prev_next_links_same_cat', 'true') ? true : false; $prev = get_previous_post($is_in_same_cat); if ($prev) { if ($prev) { $data['prev']['id'] = $prev->ID; $data['prev']['url'] = get_permalink($prev->ID); $data['prev']['title'] = get_the_title($prev->ID); $data['prev']['date'] = date(get_option('date_format'), strtotime($prev->post_date_gmt)); } } $next = get_next_post($is_in_same_cat); if ($next) { if ($next) { $data['next']['id'] = $next->ID; $data['next']['url'] = get_permalink($next->ID); $data['next']['title'] = get_the_title($next->ID); $data['next']['date'] = date(get_option('date_format'), strtotime($next->post_date_gmt)); } } return $data; }
KopaLayout::get_breadcrumb(); ?> <div class="container"> <div id="main-content" class="pull-left"> <?php if (have_posts()) { $metadata = array(); $metadata['cats'] = KopaOptions::get_option('is_display_post_category', true, 'Boolean'); $metadata['date'] = KopaOptions::get_option('is_display_post_datetime', true, 'Boolean'); $metadata['comments'] = KopaOptions::get_option('is_display_post_comments', true, 'Boolean'); $metadata['views'] = KopaOptions::get_option('is_display_post_views', true, 'Boolean'); $metadata['likes'] = KopaOptions::get_option('is_display_post_likes', true, 'Boolean'); $metadata['shares'] = KopaOptions::get_option('is_display_post_shares', true, 'Boolean'); $metadata['tags'] = KopaOptions::get_option('is_display_post_tag', true, 'Boolean'); $metadata['thumb'] = KopaOptions::get_option('is_display_post_thumbnail_standard', true, 'Boolean'); $metadata['thumb_other'] = KopaOptions::get_option('is_display_post_thumbnail_other', true, 'Boolean'); while (have_posts()) { the_post(); $post_id = get_the_ID(); $post_url = get_permalink(); $post_title = get_the_title(); $post_format = get_post_format(); ?> <article <?php post_class(array('post-content')); ?> > <header class="clearfix"> <h1 class="title-post entry-title"><?php echo $post_title; ?>
} $post->add_meta_box(__('Custom Thumbnails', kopa_get_domain()), 'kopa-metabox-post-custom-thumbnail', $second_metaboxes); } } /** * Add metaboxes "SEO" for Post */ if ('true' == KopaOptions::get_option('seo_status', 'false')) { $metaboxes['fields'] = array(array('type' => 'textarea', 'id' => KOPA_OPT_PREFIX . 'seo_keywords', 'name' => KOPA_OPT_PREFIX . 'seo_keywords', 'label' => __('Keywords', kopa_get_domain()), 'help' => __('Enter keyword(s) of current post, separated by comma.', kopa_get_domain()), 'classes' => array('linedtextarea'), 'attributes' => array('rows' => 4), 'default' => ''), array('type' => 'textarea', 'id' => KOPA_OPT_PREFIX . 'seo_descriptions', 'name' => KOPA_OPT_PREFIX . 'seo_descriptions', 'label' => __('Description', kopa_get_domain()), 'help' => __('Enter description of current post', kopa_get_domain()), 'classes' => array('linedtextarea'), 'attributes' => array('rows' => 4), 'default' => '')); $post->add_meta_box(__('SEO - Search engine optimization', kopa_get_domain()), 'kopa-metabox-post-seo', $metaboxes); } /** * Add metaboxes for post's taxonomies */ $limis = array(); $limis['inherit'] = __('-- Inherit setting from Reading Settings --', kopa_get_domain()); $limis['-1'] = __('Display all posts on a page', kopa_get_domain()); for ($i = 1; $i <= 100; $i++) { $limis[$i] = $i; } $taxonomy_fields = array(); $taxonomy_fields[] = array('type' => 'select', 'id' => KOPA_OPT_PREFIX . 'posts_per_page', 'name' => KOPA_OPT_PREFIX . 'posts_per_page', 'label' => __('Posts per page', kopa_get_domain()), 'default' => 'inherit', 'classes' => array('percent30'), 'options' => $limis); $taxonomy_fields[] = array('type' => 'select', 'id' => KOPA_OPT_PREFIX . 'is_display_content_formatted', 'name' => KOPA_OPT_PREFIX . 'is_display_content_formatted', 'default' => 'inherit', 'label' => __('Is display content formatted', kopa_get_domain()), 'classes' => array('percent30'), 'options' => array('inherit' => __('-- Inherit setting from Theme Options --', kopa_get_domain()), 'true' => __('Yes', kopa_get_domain()), 'false' => __('No', kopa_get_domain()))); $taxonomy_fields[] = array('type' => 'checkbox', 'id' => KOPA_OPT_PREFIX . 'is_use_custom_layout', 'name' => KOPA_OPT_PREFIX . 'is_use_custom_layout', 'default' => 'false', 'classes' => array('ckb_is_use_custom_layout_toggle'), 'label' => __('Is use custom layout for this post', kopa_get_domain()), 'is_append_label_before_control' => false, 'help' => NULL, 'attributes' => array('onchange' => 'KopaLayout.isUseCustomLayoutToggle(event, jQuery(this));')); $taxonomy_fields[] = array('type' => 'layout', 'id' => KOPA_OPT_PREFIX . 'layout', 'name' => KOPA_OPT_PREFIX . 'layout', 'label' => NULL, 'default' => $tmp_kopaSettings['taxonomy'], 'template_hierarchy' => 'taxonomy'); if ('true' == KopaOptions::get_option('seo_status', 'false')) { $taxonomy_fields[] = array('type' => 'textarea', 'id' => KOPA_OPT_PREFIX . 'seo_keywords', 'name' => KOPA_OPT_PREFIX . 'seo_keywords', 'label' => __('Keywords', kopa_get_domain()), 'classes' => array('linedtextarea'), 'attributes' => array('rows' => 4), 'default' => ''); $taxonomy_fields[] = array('type' => 'textarea', 'id' => KOPA_OPT_PREFIX . 'seo_descriptions', 'name' => KOPA_OPT_PREFIX . 'seo_descriptions', 'label' => __('Description', kopa_get_domain()), 'classes' => array('linedtextarea'), 'attributes' => array('rows' => 4), 'default' => ''); } $post->add_taxonomy_fields($taxonomy_fields, 'category'); $post->add_taxonomy_fields($taxonomy_fields, 'post_tag');
/** * Enqueue custom font - selected by admin * * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 * * @return NULl */ function load_font() { global $google_font; $character_sets = KopaOptions::get_option('character_sets', array()); $subset = ''; if (!empty($character_sets)) { $subset = sprintf('&subset=%s', implode(',', $character_sets)); } $typos = kopa_options_typography(); foreach ($typos as $group) { foreach ($group['fields'] as $field) { if ('font' == $field['type']) { $value = KopaOptions::get_option($field['name'], $field['default']); if (isset($value) || !empty($value)) { if ('off' != $value['family']) { $font_family = str_replace(' ', '+', $google_font['items'][$value['family']]['family']); $cssID = sprintf('css-dynamic-%s-family', $field['name']); $tmp = sprintf('http://fonts.googleapis.com/css?family=%s:%s%s', $font_family, $value['weight'], $subset); wp_enqueue_style($cssID, $tmp, array(), NULL); $this->typography[$field['name']] = $value; $this->typography[$field['name']]['family'] = $google_font['items'][$value['family']]['family']; } } } } } }
<?php if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) { die(__('Please do not load this page directly. Thanks!', kopa_get_domain())); } if (post_password_required()) { return; } if (is_single() && 'true' != KopaOptions::get_option('is_display_post_comments_system', 'true')) { return; } global $kopaCurrentLayout; ?> <div id="comments"> <?php if (have_comments()) { global $post; ?> <h3 class="comments-title"><span><span><span><?php echo KopaUtil::get_comments($post->ID); ?> </span></span></span></h3> <ul class="comment-list clearfix"> <?php wp_list_comments(array('walker' => null, 'style' => 'ul', 'short_ping' => true, 'callback' => 'kopa_list_comments', 'type' => 'all')); ?> </ul> <?php
?> <div id="<?php printf('kopa-group-%s', KopaUtil::str_uglify($groups['title'])); ?> "> <p class="kopa-tab-title clearfix"><span class="kopa-tab-title-left pull-left"><?php echo $groups['title']; ?> </span></p> <div class="kopa-tab-body" style="display: <?php echo $sub_tab_display; ?> ;"> <?php foreach ($groups['fields'] as $field) { $field['value'] = KopaOptions::get_option($field['name'], $field['default']); if (empty($field['label']) || !isset($field['label'])) { $theme_options_args['control_begin'] = '<div class="col-xs-12">'; } else { $theme_options_args['control_begin'] = '<div class="col-xs-9">'; } echo KopaControl::get_html(array_merge($theme_options_args, $field)); } ?> </div> </div> <?php } ?> </div> <?php
/** * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 */ function kopa_get_social_links() { $social_links = KopaInit::get_social_icons(); ?> <ul id="header-social-links"> <?php foreach ($social_links as $slug => $info) { $href = KopaOptions::get_option("social_link_{$slug}"); if ('rss' == $slug) { if (empty($href)) { $href = get_bloginfo_rss('rss2_url'); } elseif ('HIDE' == $href) { $href = ''; } } if (!empty($href)) { printf('<li><a class="kopa-social-link" href="%s" target="_blank" title="%s" rel="nofollow"><i class="%s"></i></a></li>', $href, $info['title'], $info['icon']); } } ?> </ul> <?php }
?> <div class="container"> <div id="main-content" class="pull-left"> <?php if (have_posts()) { global $post; $exceprt_type = KopaOptions::get_option('exceprt_type', 'limit'); $excerpt_limit = KopaOptions::get_option('excerpt_limit', 200, 'Int'); $metadata = array(); $metadata['date'] = KopaOptions::get_option('is_display_created_date', true, 'Boolean'); $metadata['comments'] = KopaOptions::get_option('is_display_comments', true, 'Boolean'); $metadata['views'] = KopaOptions::get_option('is_display_views', true, 'Boolean'); $metadata['likes'] = KopaOptions::get_option('is_display_likes', true, 'Boolean'); $metadata['readmore'] = KopaOptions::get_option('is_display_readmore', true, 'Boolean'); $metadata['formatted'] = apply_filters('kopa_blog_is_display_blog_post_format', KopaOptions::get_option('is_display_blog_post_format', true, 'Boolean')); ?> <div class="list-post-cat"> <ul class="list-post-cat-item list-unstyled"> <?php $loop_index = 0; while (have_posts()) { the_post(); $post_id = get_the_ID(); $post_url = get_permalink(); $post_title = get_the_title(); $post_format = get_post_format(); $post_classes = 0 == $loop_index ? array('blog-page-1-first-post') : array(); ?> <li <?php
<?php $youtube_params = array(); $youtube_params['showinfo'] = 'true' == KopaOptions::get_option('is_youtube_showinfo', 'false') ? 1 : 0; $youtube_params['hd'] = (int) ('true' == KopaOptions::get_option('is_youtube_hd_enable', 'false')) ? 1 : 0; $youtube_params['rel'] = (int) ('true' == KopaOptions::get_option('is_youtube_rel_enable', 'false')) ? 1 : 0; $youtube_params['theme'] = KopaOptions::get_option('youtube_theme', 'light'); $youtube_params['controls'] = (int) KopaOptions::get_option('youtube_controls', '2'); $youtube_url_params = array(); foreach ($youtube_params as $key => $val) { $youtube_url_params[] = "{$key}={$val}"; } add_shortcode('youtube', 'kopa_shortcode_youtube'); /** * * * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 * */ function kopa_shortcode_youtube($atts, $content = null) { extract(shortcode_atts(array('id' => ''), $atts)); $out = NULL; if (isset($atts['id']) && !empty($atts['id'])) { global $youtube_url_params; $out .= '<div class="video-wrapper"><iframe src="http://www.youtube.com/embed/' . $atts['id'] . '?' . implode('&', $youtube_url_params) . '" frameborder="0" allowfullscreen></iframe></div>'; } return apply_filters('kopa_shortcode_youtube', force_balance_tags($out));
<?php $vimeo_params = array(); $vimeo_params['title'] = 'true' == KopaOptions::get_option('is_show_vimeo_title', 'false') ? 1 : 0; $vimeo_params['byline'] = (int) ('true' == KopaOptions::get_option('is_show_vimeo_byline', 'false')) ? 1 : 0; $vimeo_params['portrait'] = (int) ('true' == KopaOptions::get_option('is_show_vimeo_portrait', 'false')) ? 1 : 0; $vimeo_params['color'] = str_replace('#', '', KopaOptions::get_option('vimeo_color', '#00adef')); $vimeo_url_params = array(); foreach ($vimeo_params as $key => $val) { $vimeo_url_params[] = "{$key}={$val}"; } add_shortcode('vimeo', 'kopa_shortcode_vimeo'); /** * * * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 * */ function kopa_shortcode_vimeo($atts, $content = null) { extract(shortcode_atts(array('id' => ''), $atts)); $out = NULL; if (isset($atts['id']) && !empty($atts['id'])) { global $vimeo_url_params; $out .= '<div class="video-wrapper"><iframe src="http://player.vimeo.com/video/' . $atts['id'] . '?' . implode('&', $vimeo_url_params) . '" frameborder="0" allowfullscreen></iframe></div>'; } return apply_filters('kopa_shortcode_vimeo', force_balance_tags($out)); }
<?php $footer_infor = KopaOptions::get_option('copyright'); ?> <?php if ($footer_infor || has_nav_menu('bottom-nav')) { ?> <div id="page-footer" > <div class="container"> <?php if ($footer_infor) { ?> <p class="copy-right pull-left"><?php echo $footer_infor; ?> </p> <?php } ?> <?php #BOTTOM MENU if (has_nav_menu('bottom-nav')) { wp_nav_menu(array('theme_location' => 'bottom-nav', 'container' => false, 'menu_id' => 'bottom-menu', 'menu_class' => 'list-inline pull-right bottom-menu')); } ?> </div> </div> <?php }
} ?> <span class="primary-menu-mobile-button"><span class="fa fa-bars"></span></span> <?php #TOP MENU MOBILE if (has_nav_menu('primary-nav')) { wp_nav_menu(array('theme_location' => 'primary-nav', 'container' => false, 'menu_id' => 'menu-primary-mobile', 'menu_class' => 'nav menu-primary-mobile')); } ?> <?php #SEARCH FORM if ('true' == KopaOptions::get_option('is_display_search_form', 'true')) { ?> <div class="search-box pull-right"> <?php get_search_form(); ?> </div> <?php } ?> </div> </div> <?php }
public function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $uri = $instance['uri']; $description = $instance['description']; echo $before_widget; $social_links = KopaInit::get_social_icons(); echo '<div class="like-box clearfix">'; foreach ($social_links as $slug => $info) { $href = KopaOptions::get_option("social_link_{$slug}"); if ('rss' == $slug) { if (empty($href)) { $href = get_bloginfo_rss('rss2_url'); } elseif ('HIDE' == $href) { $href = ''; } } if (!empty($href)) { printf('<a class="kopa-social-link" href="%1$s" target="_blank" title="%2$s" rel="nofollow"><i class="%3$s"></i></a>', $href, $info['title'], $info['icon']); } } echo '</div>'; if ($uri) { ?> <div class="kp-newsletter"> <?php if (!empty($title)) { echo $before_title . $title . $after_title; } echo $description ? "<p>{$description}</p>" : ''; ?> <form class="newsletter-form clearfix" action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=<?php echo $uri; ?> ', 'popupwindow', 'scrollbars=yes,width=550,height=520'); return true;"> <p class="input-email clearfix"> <input type="text" name="email" value="" placeholder="<?php _e('Your Email', kopa_get_domain()); ?> " class="form-control email"> <input type="hidden" value="<?php echo $uri; ?> " name="uri"/> <input type="hidden" name="loc" value="en_US"/> <input type="submit" value="<?php _e('Subscribe', kopa_get_domain()); ?> " class="submit"> </p> </form> <div class="newsletter-response"></div> </div> <?php } echo $after_widget; }
function kopa_load_timeline_posts_fn($month, $year, $paged) { $args = array('date_query' => array('post_type' => array('post'), 'post_status' => array('publish'), 'ignore_sticky_posts' => true, array('year' => $year, 'month' => $month))); if ($paged) { $args['paged'] = $paged; } $posts = new WP_Query($args); $exceprt_type = KopaOptions::get_option('exceprt_type', 'limit'); $excerpt_limit = KopaOptions::get_option('excerpt_limit', 200, 'Int'); $metadata = array(); $metadata['date'] = false; $metadata['comments'] = KopaOptions::get_option('is_display_comments', true, 'Boolean'); $metadata['views'] = KopaOptions::get_option('is_display_views', true, 'Boolean'); $metadata['likes'] = KopaOptions::get_option('is_display_likes', true, 'Boolean'); $metadata['readmore'] = KopaOptions::get_option('is_display_readmore', true, 'Boolean'); global $post; while ($posts->have_posts()) { $posts->the_post(); $post_id = get_the_ID(); $post_title = get_the_title(); $post_url = get_permalink(); $post_format = get_post_format(); if (!is_sticky()) { ?> <div class="item clearfix"> <p class="kopa-timeline-date-small"><?php echo get_the_date(); ?> </p> <?php if (has_post_thumbnail()) { $image_full = KopaImage::get_post_image_src($post_id, 'full'); $image_croped = KopaImage::get_post_image_src($post_id, 'size_09'); ?> <div class="kopa-thumb"> <img src="<?php echo $image_croped; ?> " alt="<?php echo $post_title; ?> "/> <div class="mask"></div> <a href="<?php echo $post_url; ?> " class="icon-link fa fa-link fa-flip-horizontal"></a> <span class="icon-zoom-in fa fa-search-plus" onclick="KopaLightbox.open_image('<?php echo $image_full; ?> ');"></span> </div> <?php } ?> <div class="kp-caption"> <h4 class="post-title"><a href="<?php echo $post_url; ?> " title="<?php echo $post_title; ?> "><?php echo $post_title; ?> </a></h4> <ul class="kp-meta-post list-inline"> <?php $is_first = true; foreach ($metadata as $key => $val) { if ($val) { $class = $is_first ? 'metadata-first' : ''; $is_first = false; switch ($key) { case 'date': printf('<li class="%s">%s<span>%s</span></li>', $class, KopaIcon::getIconDatetime(), get_the_date()); break; case 'comments': ?> <li class="<?php echo $class; ?> "><?php echo KopaIcon::getIconComment(); ?> <span><?php comments_popup_link(__('No Comment', kopa_get_domain()), __('1 Comment', kopa_get_domain()), __('% Comments', kopa_get_domain()), '', __('0 Comment', kopa_get_domain())); ?> </span></li> <?php break; case 'views': printf('<li class="%s">%s<span>%s</span></li>', $class, KopaIcon::getIconView(), KopaUtil::get_views($post_id, true)); break; case 'likes': printf('<li class="%s">%s</li>', $class, KopaUtil::kopa_get_like_button($post_id, true)); break; } } } ?> </ul> <?php if ('excerpt' == $exceprt_type) { if (has_excerpt()) { printf('<p>%s</p>', get_the_excerpt()); } else { global $post; if (strpos($post->post_content, '<!--more-->')) { the_content(' '); } else { printf('<p>%s</p>', get_the_excerpt()); } } } elseif ('full' == $exceprt_type) { global $more; $more = true; the_content(); } else { if ($excerpt_limit) { $excerpt = KopaUtil::substr($post->post_content, $excerpt_limit); echo $excerpt ? sprintf('<p>%s</p>', $excerpt) : ''; } } ?> <?php if ($metadata['readmore'] && 'full' != $exceprt_type) { ?> <a href="<?php echo $post_url; ?> " class="read-more"><?php _e('Read more', kopa_get_domain()); ?> </a> <?php } ?> </div> <!-- kp-caption --> <div class="more-i"> <div class="more-time"> <span><?php echo get_the_date('M d'); ?> </span> <i><?php echo get_the_date('Y'); ?> </i> </div> <span></span> <?php echo KopaIcon::getIconPostFormat($post_format); ?> </div> <!-- more i --> </div> <?php } } wp_reset_postdata(); }
/** * * * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 * */ function kopa_shortcode_contact_form($atts, $content = null) { global $kopa; $content = ''; #Get config information $mail = KopaOptions::get_option('contact_email'); $phone = KopaOptions::get_option('contact_phone'); $fax = KopaOptions::get_option('contact_fax'); $address = KopaOptions::get_option('contact_address'); $google_map = KopaOptions::get_option('contact_map'); $info_caption = KopaOptions::get_option('contact_info_caption'); $info_description = KopaOptions::get_option('contact_info_description'); $form_caption = KopaOptions::get_option('contact_form_caption'); $form_description = KopaOptions::get_option('contact_form_description'); $recaptcha_skin = KopaOptions::get_option('recaptcha_skin', 'off'); $publickey = KopaOptions::get_option('recaptcha_public_key'); $privatekey = KopaOptions::get_option('recaptcha_private_key'); if ($google_map) { $maps_arr = explode(',', $google_map); if (2 == count($maps_arr)) { $content .= sprintf("<div id='kp-map' class='kp-map' data-latitude='%s' data-longitude='%s'></div>", $maps_arr[0], $maps_arr[1]); } } $content .= '<div class="contact-info">'; $content .= '<div class="container">'; $content .= $info_caption ? sprintf('<h3 class="contact-title">%s</h3>', $info_caption) : ''; $content .= $info_description ? sprintf('<p>%s</p>', $info_description) : ''; if ($mail || $phone || $working_time || $address) { $number_of_cols = 0; $number_of_cols = !empty($mail) ? $number_of_cols + 1 : $number_of_cols; $number_of_cols = !empty($phone) ? $number_of_cols + 1 : $number_of_cols; $number_of_cols = !empty($fax) ? $number_of_cols + 1 : $number_of_cols; $number_of_cols = !empty($address) ? $number_of_cols + 1 : $number_of_cols; $col_classes = array(); switch ($number_of_cols) { case '1': $col_classes = array('col-xs-12'); break; case '2': $col_classes = array('col-md-6', 'col-sm-6', 'col-xs-6'); break; case '3': $col_classes = array('col-md-4', 'col-sm-6', 'col-xs-6'); break; default: $col_classes = array('col-md-3', 'col-sm-6', 'col-xs-6'); break; } $content .= '<div class="row">'; if (!empty($address)) { $content .= sprintf('<div class="%s">', implode(' ', $col_classes)); $content .= '<div class="item">'; $content .= sprintf('<span>%s</span>', KopaIcon::getIcon('fa fa-map-marker')); $content .= sprintf('<h4>%s</h4>', __('Address', kopa_get_domain())); $content .= sprintf('<p>%s</p>', $address); $content .= '</div>'; $content .= '</div>'; } if (!empty($phone)) { $content .= sprintf('<div class="%s">', implode(' ', $col_classes)); $content .= '<div class="item">'; $content .= sprintf('<span>%s</span>', KopaIcon::getIcon('fa fa-phone')); $content .= sprintf('<h4>%s</h4>', __('Phone number', kopa_get_domain())); $content .= sprintf('<p>%s</p>', $phone); $content .= '</div>'; $content .= '</div>'; } if (!empty($fax)) { $content .= sprintf('<div class="%s">', implode(' ', $col_classes)); $content .= '<div class="item">'; $content .= sprintf('<span>%s</span>', KopaIcon::getIcon('fa fa-print')); $content .= sprintf('<h4>%s</h4>', __('Fax number', kopa_get_domain())); $content .= sprintf('<p>%s</p>', $fax); $content .= '</div>'; $content .= '</div>'; } if (!empty($mail)) { $content .= sprintf('<div class="%s">', implode(' ', $col_classes)); $content .= '<div class="item">'; $content .= sprintf('<span>%s</span>', KopaIcon::getIcon('fa fa-envelope-o')); $content .= sprintf('<h4>%s</h4>', __('Email', kopa_get_domain())); $content .= sprintf('<p>%s</p>', $mail); $content .= '</div>'; $content .= '</div>'; } $content .= '</div>'; } $content .= '</div>'; $content .= '</div>'; $content .= '<div class="form-contact">'; $content .= '<div class="container">'; $content .= $form_caption ? sprintf('<h3 class="contact-title">%s</h3>', $form_caption) : ''; $content .= $form_description ? sprintf('<p>%s</p>', $form_description) : ''; $content .= '<form id="contact-form" class="contact-form clearfix" action="' . admin_url('admin-ajax.php') . '" method="post" autocomplete="off">'; $content .= '<div class="row">'; $content .= '<div class="col-md-6 col-sm-6 col-sx-12">'; $content .= '<div class="form-group">'; $content .= sprintf('<input class="form-control" type="text" id="contact_name" name="contact_name" placeholder="%s">', __('Name', kopa_get_domain())); $content .= '</div>'; $content .= '</div>'; $content .= '<div class="col-md-6 col-sm-6 col-sx-12">'; $content .= '<div class="form-group">'; $content .= sprintf('<input class="form-control" type="text" id="contact_email" name="contact_email" placeholder="%s">', __('Email', kopa_get_domain())); $content .= '</div>'; $content .= '</div>'; $content .= '</div>'; $content .= '<div class="form-group">'; $content .= sprintf('<textarea class="form-control" id="contact_message" name="contact_message" placeholder="%s"></textarea>', __('Your message', kopa_get_domain())); $content .= '</div>'; if ('off' != $recaptcha_skin && $publickey && $privatekey) { $content .= '<div class="recaptcha-block clearfix">'; $content .= recaptcha_get_html($publickey); $content .= '</div>'; } #SUBMIT $content .= '<div class="contact-button">'; $content .= '<input type="hidden" name="action" value="kopa_send_contact">'; $content .= wp_nonce_field('kopa_send_contact', 'ajax_nonce', true, false); $content .= wp_nonce_field('kopa_check_recaptcha', 'ajax_nonce_recaptcha', false, false); $content .= '<input type="submit" name="submit-contact" id="submit-contact" class="btn btn-block style-5" value="' . __('Send', kopa_get_domain()) . '">'; $content .= '</div>'; $content .= '</form>'; $content .= '<div id="contact_response"></div>'; $content .= '</div>'; $content .= '</div>'; return $content; }