" ><?php echo KopaIcon::getIcon('google-plus'); ?> </a></li> <?php } ?> <?php if ($author_flickr) { ?> <li><a href="<?php echo $author_flickr; ?> " ><?php echo KopaIcon::getIcon('flickr'); ?> </a></li> <?php } ?> </ul> </div><!--author-content--> </div><!--about-author-detail--> </div><!--about-author--> <?php } ?> <?php kopa_get_related_articles();
function kopa_edit_extra_category_fields($tag) { //check for existing featured ID $t_id = $tag->term_id; $kopa_category_setting_key = "kopa_category_setting_" . $t_id; global $KOPA_SETTING; $kopa_category_setting = get_option($kopa_category_setting_key, array()); $kopa_disable = ''; if (empty($kopa_category_setting)) { $kopa_disable = ' disabled'; $kopa_checked = ''; $kopa_checked_value = "No"; $kopa_category_setting = $KOPA_SETTING["taxonomy"]; } else { $kopa_checked = 'checked ="checked"'; $kopa_disable = ''; $kopa_checked_value = "Yes"; } global $KOPA_TEMPLATE_HIERARCHY; global $KOPA_LAYOUT; global $KOPA_SIDEBAR_POSITION; global $KOPA_SIDEBAR; wp_nonce_field("save_layout_setting", "nonce_id_save"); ?> <tr class="form-field"> <th scope="row" valign="top"> </th> <td> <div class="kopa-content-box tab-content kopa-content-main-box" id="kopa-category-edit" class="kopa-category-edit"> <div class="kopa-box-head clearfix"> <h4><?php echo KopaIcon::getIcon('cog'); ?> Custom Setting Layout and Sidebar?</h4> <input onchange="show_on_checked(jQuery(this));" autocomplete="off" type="checkbox" name="kopa_custom_layout_setting" id="kopa_custom_layout_setting" class="kopa_custom_layout_setting" value="<?php echo $kopa_checked_value; ?> " <?php echo $kopa_checked; ?> > <label class="kopa-label">Check if you would like to use custom setting</label> </div><!--kopa-box-head--> <div class="kopa-box-body clearfix"> <div class="kopa-layout-box pull-left"> <div class="kopa-select-layout-box kopa-element-box"> <span class="kopa-component-title">Select the layout</span> <select name ="kopa_select_layout" class="kopa-layout-select" onchange="show_onchange(jQuery(this));" autocomplete="off" <?php echo $kopa_disable; ?> > <?php foreach ($KOPA_TEMPLATE_HIERARCHY['taxonomy']['layout'] as $keys => $value) { echo '<option value="' . $value . '"'; if ($value === $kopa_category_setting['layout_id']) { echo 'selected="selected"'; } echo '>' . $KOPA_LAYOUT[$value]['title'] . '</option>'; } ?> </select> </div><!--kopa-select-layout-box--> <?php foreach ($KOPA_TEMPLATE_HIERARCHY['taxonomy']['layout'] as $keys => $value) { foreach ($KOPA_LAYOUT as $layout_key => $layout_value) { if ($layout_key == $value) { ?> <div class="<?php echo 'kopa-sidebar-box-wrapper sidebar-position-' . $layout_key; ?> "> <?php foreach ($layout_value['positions'] as $postion_key => $postion_id) { ?> <div class="kopa-sidebar-box kopa-element-box"> <span class="kopa-component-title"><?php echo $KOPA_SIDEBAR_POSITION[$postion_id]['title']; ?> </span> <label class="kopa-label">Select sidebars</label> <?php echo '<select class="kopa-sidebar-select" autocomplete="off" ' . $kopa_disable . '>'; foreach ($KOPA_SIDEBAR as $sidebar_list_key => $sidebar_list_value) { $__selected_sidebar = ''; if ($layout_key === $kopa_category_setting['layout_id']) { if ($sidebar_list_key === $kopa_category_setting['sidebars'][$postion_key]) { $__selected_sidebar = 'selected="selected"'; } } echo '<option value="' . $sidebar_list_key . '" ' . $__selected_sidebar . '>' . $sidebar_list_value . '</option>'; $__selected_sidebar = ''; } echo '</select>'; ?> </div><!--kopa-sidebar-box--> <?php } ?> </div><!--kopa-sidebar-box-wrapper--> <?php } } } ?> </div><!--kopa-layout-box--> <div class="kopa-thumbnails-box pull-right"> <?php foreach ($KOPA_TEMPLATE_HIERARCHY['taxonomy']['layout'] as $thumbnails_key => $thumbnails_value) { ?> <image class="responsive-img <?php echo ' kopa-cpanel-thumbnails kopa-cpanel-thumbnails-' . $thumbnails_value; ?> " src="<?php echo KOPA_CPANEL_IMAGE_DIR . $KOPA_LAYOUT[$thumbnails_value]['thumbnails']; ?> " class="img-polaroid" alt=""> <?php } ?> </div><!--kopa-thumbnails-box--> </div><!--kopa-box-body--> </div><!--kopa-content-box--> </td> </tr> <?php }
function kopa_layout_page($_kopa_template_id) { global $KOPA_LAYOUT; global $KOPA_TEMPLATE_HIERARCHY; global $KOPA_SIDEBAR_POSITION; global $KOPA_SETTING; global $KOPA_SIDEBAR; wp_nonce_field("load_layout_setting", "nonce_id"); wp_nonce_field("save_layout_setting", "nonce_id_save"); ?> <div id="kopa-admin-wrapper" class="clearfix"> <div id="kopa-loading-gif"></div> <input type="hidden" id="kopa_template_id" value="<?php echo $_kopa_template_id; ?> "> <?php if ($KOPA_TEMPLATE_HIERARCHY) { echo '<div class="kopa-nav list-container"> <ul class="tabs clearfix">'; foreach ($KOPA_TEMPLATE_HIERARCHY as $kopa_template_key => $kopa_template_value) { if ($kopa_template_key === $_kopa_template_id) { $_active = "class='active'"; } else { $_active = ''; } echo '<li ' . $_active . '><span title="' . $kopa_template_key . '" onclick="load_layout_setting(jQuery(this))">' . $kopa_template_value['title'] . '</span></li>'; } echo '</ul><!--tabs---> </div><!--kopa-nav-->'; } ?> <div class="kopa-content"> <div class="kopa-page-header clearfix"> <div class="pull-left"> <h4><?php echo KopaIcon::getIcon('cog'); ?> Layout And Sidebar Manager</h4> </div> <div class="pull-right"> <div class="kopa-copyrights"> <span>Visit author URL: </span><a href="<?php echo KOPA_URL; ?> " target="_blank"><?php echo KOPA_URL; ?> </a> </div><!--="kopa-copyrights--> </div> </div><!--kopa-page-header--> <div class="tab-container"> <div class="kopa-content-box tab-content kopa-content-main-box" id="<?php echo $_kopa_template_id; ?> "> <div class="kopa-actions clearfix"> <div class="kopa-button"> <span class="btn btn-primary" onclick="save_layout_setting(jQuery(this))"><?php echo KopaIcon::getIcon('check-circle'); ?> Save</span> </div> </div><!--kopa-actions--> <div class="kopa-box-head"> <?php echo KopaIcon::getIcon('hand-right'); ?> <span class="kopa-section-title"><?php echo $KOPA_TEMPLATE_HIERARCHY[$_kopa_template_id]['title']; ?> </span> </div><!--kopa-box-head--> <div class="kopa-box-body clearfix"> <div class="kopa-layout-box pull-left"> <div class="kopa-select-layout-box kopa-element-box"> <span class="kopa-component-title">Select the layout</span> <select class="kopa-layout-select" onchange="show_onchange(jQuery(this));" autocomplete="off"> <?php foreach ($KOPA_TEMPLATE_HIERARCHY[$_kopa_template_id]['layout'] as $keys => $value) { echo '<option value="' . $value . '"'; /* foreach ($KOPA_SETTING as $kopa_setting_key => $kopa_setting_value) { if ($kopa_setting_key == $_kopa_template_id && $kopa_setting_value[layout_id] == $value) { echo 'selected="selected"'; } } */ if ($value === $KOPA_SETTING[$_kopa_template_id]['layout_id']) { echo 'selected="selected"'; } echo '>' . $KOPA_LAYOUT[$value]['title'] . '</option>'; } ?> </select> </div><!--kopa-select-layout-box--> <?php foreach ($KOPA_TEMPLATE_HIERARCHY[$_kopa_template_id]['layout'] as $keys => $value) { foreach ($KOPA_LAYOUT as $layout_key => $layout_value) { if ($layout_key == $value) { ?> <div class="<?php echo 'kopa-sidebar-box-wrapper sidebar-position-' . $layout_key; ?> "> <?php foreach ($layout_value['positions'] as $postion_key => $postion_id) { ?> <div class="kopa-sidebar-box kopa-element-box"> <span class="kopa-component-title"><?php echo $KOPA_SIDEBAR_POSITION[$postion_id]['title']; ?> </span> <label class="kopa-label">Select sidebars</label> <?php echo '<select class="kopa-sidebar-select" autocomplete="off">'; foreach ($KOPA_SIDEBAR as $sidebar_list_key => $sidebar_list_value) { $__selected_sidebar = ''; if ($layout_key === $KOPA_SETTING[$_kopa_template_id]['layout_id']) { if ($sidebar_list_key === $KOPA_SETTING[$_kopa_template_id]['sidebars'][$postion_key]) { $__selected_sidebar = 'selected="selected"'; } } echo '<option value="' . $sidebar_list_key . '" ' . $__selected_sidebar . '>' . $sidebar_list_value . '</option>'; $__selected_sidebar = ''; } echo '</select>'; ?> </div><!--kopa-sidebar-box--> <?php } ?> </div><!--kopa-sidebar-box-wrapper--> <?php } } } ?> </div><!--kopa-layout-box--> <div class="kopa-thumbnails-box pull-right"> <?php foreach ($KOPA_TEMPLATE_HIERARCHY[$_kopa_template_id]['layout'] as $thumbnails_key => $thumbnails_value) { ?> <image class="responsive-img <?php echo ' kopa-cpanel-thumbnails kopa-cpanel-thumbnails-' . $thumbnails_value; ?> " src="<?php echo KOPA_CPANEL_IMAGE_DIR . $KOPA_LAYOUT[$thumbnails_value]['thumbnails']; ?> " class="img-polaroid" alt=""> <?php } ?> </div><!--kopa-thumbnails-box--> </div><!--kopa-box-body--> <div class="kopa-actions kopa-bottom-action-bar clearfix"> <div class="kopa-button"> <span class="btn btn-primary" onclick="save_layout_setting(jQuery(this))"><?php echo KopaIcon::getIcon('check-circle'); ?> Save</span> </div> </div> </div><!--kopa-content-box--> </div><!--tab-container--> </div><!--kopa-content--> </div><!--kopa-admin-wrapper--> <?php }
<li><span lang="#tab-social-links"><?php _e('Social Links', kopa_get_domain()); ?> </span></li> <li><span lang="#tab-custom-css"><?php _e('Custom CSS', kopa_get_domain()); ?> </span></li> </ul><!--tabs--> </div><!--kopa-nav--> <div class="kopa-content"> <div class="kopa-page-header clearfix"> <div class="pull-left"> <h4><?php echo KopaIcon::getIcon('cog'); _e('Theme Options', kopa_get_domain()); ?> </h4> </div> <div class="pull-right"> <div class="kopa-copyrights"> <span><?php _e('Visit author URL:', kopa_get_domain()); ?> </span><a href="http://kopatheme.com" target="_blank">http://kopatheme.com</a> </div><!--="kopa-copyrights--> </div> </div><!--kopa-page-header--> <div class="kopa-actions clearfix">
/** * * * @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; }
/** * Template tag: print header socials link * @since FastNews 1.0 */ function kopa_header_social_links() { $social_links = array('facebook' => array('url' => '', 'icon' => 'facebook', 'display' => false), 'twitter' => array('url' => '', 'icon' => 'twitter', 'display' => false), 'pinterest' => array('url' => '', 'icon' => 'pinterest', 'display' => false), 'instagram' => array('url' => '', 'icon' => 'instagram', 'display' => false), 'gplus' => array('url' => '', 'icon' => 'google-plus', 'display' => false), 'youtube' => array('url' => '', 'icon' => 'youtube', 'display' => false), 'linkedin' => array('url' => '', 'icon' => 'linkedin', 'display' => false), 'rss' => array('url' => '', 'icon' => 'rss', 'display' => false)); foreach ($social_links as $social_name => $social_atts) { $option_name = 'kopa_theme_options_social_links_' . $social_name . '_url'; $social_atts['url'] = get_option($option_name, ''); if ('rss' == $social_name) { if (empty($social_atts['url'])) { $social_atts['url'] = get_bloginfo('rss2_url'); $social_atts['display'] = true; } elseif ($social_atts['url'] != 'HIDE') { $social_atts['url'] = esc_url($social_atts['url']); $social_atts['display'] = true; } } else { $social_atts['url'] = esc_url($social_atts['url']); if (!empty($social_atts['url'])) { $social_atts['display'] = true; } } $social_links[$social_name] = $social_atts; } $social_link_target = get_option('kopa_theme_options_social_link_target', '_self'); ?> <ul class="social-link pull-right clearfix"> <?php foreach ($social_links as $social_name => $social_atts) { ?> <?php if ($social_atts['display']) { ?> <li><a href="<?php echo $social_atts['url']; ?> " target="<?php echo $social_link_target; ?> "><?php echo KopaIcon::getIcon($social_atts['icon']); ?> </a></li> <?php } // endif ?> <?php } // endforeach ?> </ul> <?php }
<form method="get" id="<?php echo "search-form-" . rand(0, 9999); ?> " class="search-form clearfix" action="<?php echo trailingslashit(home_url()); ?> "> <div class="form-group pull-left"> <input type="text" name="s" class="form-control" onBlur="if ('' === this.value) this.value = this.defaultValue;" onFocus="if (this.value === this.defaultValue) this.value = '';" value="<?php _e('Search...', kopa_get_domain()); ?> " > </div> <button type="submit" class="search-submit"><?php echo KopaIcon::getIcon('fa fa-search'); ?> </button> </form>
?> </span> <span class="entry-author">, <?php _e('by', kopa_get_domain()); ?> <?php the_author_posts_link(); ?> </span> <span class="entry-comments"><?php echo KopaIcon::getIcon('comment', 'span'); comments_popup_link(); ?> </span> <span class="entry-view"><?php echo KopaIcon::getIcon('view', 'span'); //echo kopa_get_view_count( get_the_ID() ); ?> </span> </header> <div class="clear"></div> <div class="elements-box mt-20"> <?php //$content = get_the_content(); //$content = preg_replace('/\[gallery.*]/', '', $content); //$content = apply_filters( 'the_content', $content ); //$content = str_replace(']]>', ']]>', $content); //echo $content; the_content();
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $query_args = array(); $query_args['categories'] = empty($instance['categories']) ? array() : $instance['categories']; $query_args['posts_per_page'] = isset($instance['number_of_article']) ? $instance['number_of_article'] : -1; $query_args['orderby'] = isset($instance['orderby']) ? $instance['orderby'] : 'latest'; $display_type = isset($instance['display_type']) ? $instance['display_type'] : 'ranking'; $categories = get_terms('category'); echo $before_widget; if (!empty($title)) { echo $before_title . $title . $after_title; } $posts = kopa_widget_posttype_build_query($query_args); if (!empty($instance['categories']) && $posts->have_posts()) { ?> <div class="list-container-1"> <ul class="tabs-1 clearfix"> <?php $cat_index = 1; foreach ($categories as $category) { if (in_array($category->term_id, $instance['categories'])) { ?> <li <?php echo $cat_index == 1 ? ' class="active"' : ''; ?> ><a href="#<?php echo $this->get_field_id('tab') . '-' . $category->term_id; ?> "><?php echo $category->name; ?> </a></li> <?php } $cat_index++; // increase category index by 1 } ?> </ul><!--tabs-1--> </div> <div class="tab-container-1"> <?php foreach ($instance['categories'] as $cat_ID) { $cat_posts = new WP_Query(array('cat' => $cat_ID, 'posts_per_page' => $instance['number_of_article'])); if ($cat_posts->have_posts()) { ?> <div class="tab-content-1 kp-post-format <?php echo $display_type == 'thumbnail' ? 'kp-thumbnail-style' : ''; ?> " id="<?php echo $this->get_field_id('tab') . '-' . $cat_ID; ?> "> <ul> <?php $post_index = 1; while ($cat_posts->have_posts()) { $cat_posts->the_post(); $thumbnail = wp_get_attachment_image(get_post_thumbnail_id(), 'kopa-image-size-3'); if ($post_index == 1) { $index_class = 'kp-1st-post'; } elseif ($post_index == 2) { $index_class = 'kp-2nd-post'; } elseif ($post_index == 3) { $index_class = 'kp-3rd-post'; } else { $index_class = 'kp-nth-post'; } ?> <li> <article class="entry-item clearfix"> <?php if ($display_type == 'ranking') { ?> <span class="entry-thumb <?php echo $index_class; ?> "><?php echo $post_index; ?> </span> <?php } else { ?> <span class="entry-thumb"><a href="<?php the_permalink(); ?> "><?php if (has_post_thumbnail()) { echo $thumbnail; } // 53 x 53 ?> </a></span> <?php } // endif $display_type == ranking ?> <div class="entry-content"> <h4 class="entry-title"><a href="<?php the_permalink(); ?> "><?php echo get_the_title(); ?> </a></h4> <span class="entry-date"><span class="kopa-minus"></span><?php the_time(get_option('date_format')); ?> </span> <?php if (get_post_format() == 'video') { echo KopaIcon::getIcon('video-icon fa fa-video-camera', 'span'); } ?> </div> </article> </li> <?php $post_index++; // increase post index by 1 } ?> </ul> </div><!--tab-content-1--> <?php } wp_reset_postdata(); } ?> </div><!--tab-container-1--> <?php } // endif $posts->have_posts() wp_reset_postdata(); echo $after_widget; }
function kopa_get_about_author() { if ('show' == get_option('kopa_theme_options_post_about_author', 'hide')) { global $post; $user_id = $post->post_author; $description = get_the_author_meta('description', $user_id); $email = get_the_author_meta('user_email', $user_id); $name = get_the_author_meta('display_name', $user_id); $link = trim(get_the_author_meta('user_url', $user_id)); ?> <div class="about-author clearfix"> <a class="avatar-thumb" href="<?php echo $link; ?> "><?php echo get_avatar($email, 90); ?> </a> <div class="author-content"> <header class="clearfix"> <h4><?php _e('Posted by:', kopa_get_domain()); ?> </h4> <a class="author-name" href="<?php echo $link; ?> "><?php echo $name; ?> </a> <?php $social_links['facebook'] = get_user_meta($user_id, 'facebook', true); $social_links['twitter'] = get_user_meta($user_id, 'twitter', true); $social_links['google-plus'] = get_user_meta($user_id, 'google-plus', true); if ($social_links['facebook'] || $social_links['twitter'] || $social_links['google-plus']) { ?> <ul class="clearfix social-link"> <li><?php _e('Follow:', kopa_get_domain()); ?> </li> <?php if ($social_links['facebook']) { ?> <li class="facebook-icon"><a target="_blank" title="<?php _e('Facebook', kopa_get_domain()); ?> " href="<?php echo $social_links['facebook']; ?> " rel="nofollow" ><?php echo KopaIcon::getIcon('facebook'); ?> </a> </li> <?php } ?> <?php if ($social_links['twitter']) { ?> <li class="twitter-icon"><a target="_blank" title="<?php _e('Twitter', kopa_get_domain()); ?> " class="twitter" href="<?php echo $social_links['twitter']; ?> " rel="nofollow"><?php echo KopaIcon::getIcon('twitter'); ?> </a> </li> <?php } ?> <?php if ($social_links['google-plus']) { ?> <li class="gplus-icon"><a target="_blank" title="<?php _e('Google+', kopa_get_domain()); ?> " class="gplus" href="<?php echo $social_links['google-plus']; ?> " rel="nofollow"><?php echo KopaIcon::getIcon('google-plus'); ?> </a> </li> <?php } ?> </ul><!--social-link--> <?php } ?> </header> <div><?php echo $description; ?> </div> </div> <!--author-content--> </div><!--about-author--> <?php } }
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; } $dribbble_url = esc_url(kopa_get_option('kopa_theme_options_social_links_dribbble_url')); $gplus_url = esc_url(kopa_get_option('kopa_theme_options_social_links_gplus_url')); $facebook_url = esc_url(kopa_get_option('kopa_theme_options_social_links_facebook_url')); $twitter_url = esc_url(kopa_get_option('kopa_theme_options_social_links_twitter_url')); $rss_url = kopa_get_option('kopa_theme_options_social_links_rss_url'); $flickr_url = esc_url(kopa_get_option('kopa_theme_options_social_links_flickr_url')); $youtube_url = esc_url(kopa_get_option('kopa_theme_options_social_links_youtube_url')); $social_link_target = kopa_get_option('kopa_theme_options_social_link_target'); ?> <ul class="clearfix"> <!-- dribbble --> <?php if (!empty($dribbble_url)) { ?> <li><a href="<?php echo $dribbble_url; ?> " target="<?php echo $social_link_target; ?> "><?php echo KopaIcon::getIcon('dribbble'); ?> </a></li> <?php } ?> <!-- google plus --> <?php if (!empty($gplus_url)) { ?> <li><a href="<?php echo $gplus_url; ?> " target="<?php echo $social_link_target; ?> "><?php echo KopaIcon::getIcon('google-plus'); ?> </a></li> <?php } ?> <!-- facebook --> <?php if (!empty($facebook_url)) { ?> <li><a href="<?php echo $facebook_url; ?> " target="<?php echo $social_link_target; ?> "><?php echo KopaIcon::getIcon('facebook'); ?> </a></li> <?php } ?> <!-- twitter --> <?php if (!empty($twitter_url)) { ?> <li><a href="<?php echo $twitter_url; ?> " target="<?php echo $social_link_target; ?> "><?php echo KopaIcon::getIcon('twitter'); ?> </a></li> <?php } ?> <!-- rss --> <?php if ($rss_url != 'HIDE') { if (empty($rss_url)) { $rss_url = get_bloginfo('rss2_url'); } else { $rss_url = esc_url($rss_url); } ?> <li><a href="<?php echo $rss_url; ?> " target="<?php echo $social_link_target; ?> "><?php echo KopaIcon::getIcon('rss'); ?> </a></li> <?php } // endif ?> <!-- flickr --> <?php if (!empty($flickr_url)) { ?> <li><a href="<?php echo $flickr_url; ?> " target="<?php echo $social_link_target; ?> "><?php echo KopaIcon::getIcon('flickr'); ?> </a></li> <?php } ?> <!-- youtube --> <?php if (!empty($youtube_url)) { ?> <li><a href="<?php echo $youtube_url; ?> " target="<?php echo $social_link_target; ?> "><?php echo KopaIcon::getIcon('youtube'); ?> </a></li> <?php } ?> </ul> <?php echo $after_widget; }
} ?> <!-- flickr --> <?php if ($kopa_flickr_url) { echo sprintf('<li><a title="Flickr" href="%2$s" target="_blank" rel="nofollow" >%1$s</a></li>', KopaIcon::getIcon('flickr'), $kopa_flickr_url); } ?> <!-- rss --> <?php if (empty($kopa_rss_url)) { echo sprintf('<li><a title="RSS" href="%2$s" target="_blank" rel="nofollow" >%1$s</a></li>', KopaIcon::getIcon('rss'), get_bloginfo('rss2_url')); } elseif ($kopa_rss_url != 'HIDE') { echo sprintf('<li><a href="%2$s" target="_blank" rel="nofollow" >%1$s</a></li>', KopaIcon::getIcon('rss'), esc_url($kopa_rss_url)); } ?> </ul><!--social-links--> <div class="sb-search-wrapper"> <div id="sb-search" class="sb-search"> <form method="get" action="<?php echo esc_url(home_url()); ?> "> <input class="sb-search-input" placeholder="<?php _e('Enter your search term...', kopa_get_domain()); ?> " type="text" value="" name="s" id="search"> <input class="sb-search-submit" type="submit" value="">
function kopa_ajax_load_quick_sort_articles() { if (!wp_verify_nonce($_POST['wpnonce'], 'kopa_load_quick_sort_articles')) { echo null; die; } $output = ''; $offset = $_POST['offset']; $categories = $_POST['categories']; $categories = explode(',', $categories); $posts_per_page = $_POST['posts_per_page']; $orderby = $_POST['orderby']; $post__not_in = explode(',', $_POST['post__not_in']); $query_args = array('category__in' => $categories, 'posts_per_page' => $posts_per_page); if ($orderby != 'random') { $query_args['offset'] = $offset; } switch ($orderby) { case 'popular': $query_args['meta_key'] = 'kopa_' . kopa_get_domain() . '_total_view'; $query_args['orderby'] = 'meta_value_num'; break; case 'most_comment': $query_args['orderby'] = 'comment_count'; break; case 'random': $query_args['orderby'] = 'rand'; $query_args['post__not_in'] = $post__not_in; break; default: $query_args['orderby'] = 'date'; break; } $posts = new WP_Query($query_args); if ($posts->have_posts()) { while ($posts->have_posts()) { $posts->the_post(); array_push($post__not_in, get_the_ID()); $post_terms = get_the_terms(get_the_ID(), 'category'); $data_category = array(); $has_printed_thumbnail = false; if ('video' == get_post_format()) { $data_icon = 'video'; // icon-film-2 } elseif ('gallery' == get_post_format()) { $data_icon = 'images'; // icon-images } elseif ('audio' == get_post_format()) { $data_icon = 'music'; // icon-music } else { $data_icon = 'pencil'; // icon-pencil } foreach ($post_terms as $post_term) { if (in_array($post_term->term_id, $categories)) { array_push($data_category, $post_term->slug); } } if (!empty($data_category)) { $data_category = implode(' ', $data_category); } else { $data_category = ''; } $output .= '<article class="element ' . $data_category . '" data-category="' . $data_category . '">'; $output .= '<div class=top-line>'; $output .= '</div><div class=entry-thumb>'; if (has_post_thumbnail()) { $output .= wp_get_attachment_image(get_post_thumbnail_id(), 'kopa-image-size-6'); // 496 x 346 $has_printed_thumbnail = true; } elseif ('video' == get_post_format()) { $video = kopa_content_get_video(get_the_content()); if (isset($video[0])) { $video = $video[0]; } else { $video = ''; } if (isset($video['type']) && isset($video['url'])) { $video_thumbnail_url = kopa_get_video_thumbnails_url($video['type'], $video['url']); $output .= '<img src="' . esc_url($video_thumbnail_url) . '" alt="' . get_the_title() . '">'; $has_printed_thumbnail = true; } } elseif ('gallery' == get_post_format()) { $gallery_ids = kopa_content_get_gallery_attachment_ids(get_the_content()); if (!empty($gallery_ids)) { foreach ($gallery_ids as $id) { if (wp_attachment_is_image($id)) { $output .= wp_get_attachment_image($id, 'kopa-image-size-6'); // 496 x 346 $has_printed_thumbnail = true; break; } } } } // endif has_post_thumbnail if ($has_printed_thumbnail) { $output .= '<a href="' . get_permalink() . '">' . KopaIcon::getIcon('long-arrow-right') . '</a>'; } $output .= '</div>'; $output .= '<div class=entry-content><header>'; $output .= '<h4 class="entry-title clearfix">' . KopaIcon::getIcon($data_icon, 'span') . '<a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>'; $output .= '<div class="meta-box">'; $output .= '<span class="entry-date">' . get_the_time(get_option('date_format')) . '</span> '; $output .= '<span class="entry entry-author">' . __('By', kopa_get_domain()) . ' <a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" title="' . __('Posts by', kopa_get_domain()) . ' ' . get_the_author() . '" rel="author">' . get_the_author() . '</a></span>'; $output .= '</div></header>'; $output .= '<p>' . get_the_excerpt() . '</p>'; $output .= '<footer class=clearfix>'; $output .= '<div class=meta-box>'; $output .= '<span class=entry-comments>' . KopaIcon::getIcon('comment', 'span'); if (comments_open()) { $output .= '<a href="' . get_comments_link() . '" title="' . __('Comment on') . ' ' . get_the_title() . '">' . get_comments_number() . '</a>'; } else { $output .= '<span>' . __('Off', kopa_get_domain()) . '</span>'; } $output .= '</span> '; if ('show' == get_option('kopa_theme_options_view_count_status', 'show') && true == get_post_meta(get_the_ID(), 'kopa_' . kopa_get_domain() . '_total_view', true)) { $output .= '<span class=entry-view>' . KopaIcon::getIcon('view', 'span') . get_post_meta(get_the_ID(), 'kopa_' . kopa_get_domain() . '_total_view', true) . '</span>'; } $output .= '</div> <!-- .meta-box -->'; $post_rating = round(get_post_meta(get_the_ID(), 'kopa_editor_user_total_all_rating_' . kopa_get_domain(), true)); if (!empty($post_rating)) { $output .= '<ul class="kopa-rating clearfix">'; for ($i = 0; $i < $post_rating; $i++) { $output .= '<li>' . KopaIcon::getIcon('star', 'span') . '</li>'; } for ($i = 0; $i < 5 - $post_rating; $i++) { $output .= '<li>' . KopaIcon::getIcon('star2', 'span') . '</li>'; } $output .= '</ul>'; } $output .= '</footer>'; $output .= '</div> <!-- entry-content -->'; $output .= '<div class=bottom-line></div>'; $output .= '</article>'; } wp_reset_postdata(); } else { echo null; die; } $responses_data = array('output' => $output, 'post__not_in' => implode(',', $post__not_in)); echo json_encode($responses_data); die; }
<?php $is_first = true; foreach ($metadata as $key => $val) { if ($val) { $class = $is_first ? 'metadata-first' : ''; $is_first = false; switch ($key) { case 'cats': if (has_category()) { ?> <li class="singular-categories <?php echo $class; ?> "> <?php echo KopaIcon::getIcon('fa fa-book'); ?> <?php the_category(', '); ?> </li> <?php } break; case 'date': printf('<li class="%s">%s<span>%s</span></li>', $class, KopaIcon::getIconDatetime(), get_the_date()); break; case 'comments': ?> <li class="<?php
<?php include_once trailingslashit(get_template_directory()) . '/library/includes/cpanel/theme-options/blog-slider.php'; ?> <?php include_once trailingslashit(get_template_directory()) . '/library/includes/cpanel/theme-options/post.php'; ?> <?php include_once trailingslashit(get_template_directory()) . '/library/includes/cpanel/theme-options/social-links.php'; ?> <?php include_once trailingslashit(get_template_directory()) . '/library/includes/cpanel/theme-options/custom-css.php'; ?> <div class="kopa-actions kopa-bottom-action-bar clearfix"> <div class="kopa-button"> <span class="btn btn-primary" onclick="kopa_save_general_setting(jQuery(this));"><?php echo KopaIcon::getIcon('check-circle'); _e('Save', kopa_get_domain()); ?> </span> </div> <div class="progress progress-striped active"> <div class="bar" style="width: 100%;"></div> </div> </div> </div><!--tab-container--> </div><!--kopa-content--> <div class="clear"></div> </form> </div><!--kopa-admin-wrapper-->
<div class="kopa-element-box kopa-theme-options"> <span class="kopa-component-title"><?php _e('Footer logo', kopa_get_domain()); ?> </span> <p class="kopa-desc"><?php _e('Upload your own logo.', kopa_get_domain()); ?> </p> <div class="clearfix"> <input class="left" type="text" value="<?php echo get_option('kopa_theme_options_logo_url'); ?> " id="kopa_theme_options_logo_url" name="kopa_theme_options_logo_url"> <button class="left btn btn-success upload_image_button" alt="kopa_theme_options_logo_url"><?php echo KopaIcon::getIcon('arrow-circle-up'); _e('Upload', kopa_get_domain()); ?> </button> </div> </div><!--kopa-element-box--> <div class="kopa-element-box kopa-theme-options"> <span class="kopa-component-title"><?php _e('Custom Left Footer', kopa_get_domain()); ?> </span> <p class="kopa-desc"><?php _e('Enter the content you want to display in your left footer (e.g. copyright text).', kopa_get_domain()); ?> </p> <textarea class="" rows="6" id="kopa_setting_copyrights" name="kopa_theme_options_copyright"><?php
?> <tr <?php if ($kopa_sidebar_element_key === "sidebar_hide") { echo 'style ="display:none;"'; } ?> > <td><?php echo $kopa_sidebar_element_value; ?> </td> <td><a onclick="kopa_remove_sidebar_clicked(jQuery(this), '<?php echo $kopa_sidebar_element_key; ?> ')" title="" lang="" rel="tooltip" class="button button-basic button-icon" data-original-title="Remove"><?php echo KopaIcon::getIcon('trash'); ?> </a></td> </tr> <?php } } ?> </tbody> </table> <?php } else { ?> <label id="kopa-nosidebar-label" class="kopa-label">No sidebar defined</label> <table class="table table-nomargin hidden"> <thead>
<div id="tab-custom-css" class="kopa-content-box tab-content tab-content-1"> <div class="kopa-box-head"> <?php echo KopaIcon::getIcon('hand-right'); ?> <span class="kopa-section-title"><?php _e('Custom CSS', kopa_get_domain()); ?> </span> </div><!--kopa-box-head--> <div class="kopa-box-body"> <div class="kopa-element-box kopa-theme-options"> <p class="kopa-desc"><?php _e('Enter the your custom CSS code', kopa_get_domain()); ?> </p> <textarea class="" rows="10" id="kopa_custom_css" name="kopa_theme_options[kopa_theme_options_custom_css]"><?php echo esc_html(esc_textarea(kopa_get_option('kopa_theme_options_custom_css'))); ?> </textarea> </div><!--kopa-element-box--> </div><!--tab-theme-skin--> </div><!--tab-container-->
public function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $query = $this->build_query($instance); echo $before_widget; $unique_id = wp_generate_password(4, false, false); $latest_id = "latest-{$unique_id}"; $most_comment_id = "most-comment-{$unique_id}"; $most_view_id = "most-view-{$unique_id}"; $most_like_id = "most-like-{$unique_id}"; $params = array('is_hide_title' => 'true' == $instance['is_hide_title'] ? true : false, 'is_hide_views' => 'true' == $instance['is_hide_views'] ? true : false, 'is_hide_created_date' => 'true' == $instance['is_hide_created_date'] ? true : false, 'is_hide_comments' => 'true' == $instance['is_hide_comments'] ? true : false, 'is_hide_likes' => 'true' == $instance['is_hide_likes'] ? true : false, 'is_hide_excerpt' => 'true' == $instance['is_hide_excerpt'] ? true : false, 'excerpt_character_limit' => (int) $instance['excerpt_character_limit']); ?> <header> <?php echo empty($title) ? '' : $before_title . $title . $after_title; ?> <?php if (!$params['is_hide_created_date'] || !$params['is_hide_comments'] || !$params['is_hide_views'] || !$params['is_hide_likes']) { $is_first = true; $class = ''; ?> <ul class="filter-isotope list-unstyled"> <?php if (!$params['is_hide_created_date']) { if ($is_first) { $class = 'active'; $is_first = false; } else { $class = ''; } ?> <li class="<?php echo $class; ?> "><a class="kplaf_filter_name" href="#<?php echo $latest_id; ?> "><?php echo KopaIcon::getIconDatetime(); ?> </a></li> <?php } ?> <?php if (!$params['is_hide_comments']) { if ($is_first) { $class = 'active'; $is_first = false; } else { $class = ''; } ?> <li class="<?php echo $class; ?> "><a class="kplaf_filter_name" href="#<?php echo $most_comment_id; ?> "><?php echo KopaIcon::getIconComment(); ?> </a></li> <?php } ?> <?php if (!$params['is_hide_views']) { if ($is_first) { $class = 'active'; $is_first = false; } else { $class = ''; } ?> <li class="<?php echo $class; ?> "><a class="kplaf_filter_name" href="#<?php echo $most_view_id; ?> "><?php echo KopaIcon::getIconView(); ?> </a></li> <?php } ?> <?php if (!$params['is_hide_likes']) { if ($is_first) { $class = 'active'; $is_first = false; } else { $class = ''; } ?> <li class="<?php echo $class; ?> "><a class="kplaf_filter_name" href="#<?php echo $most_like_id; ?> "><?php echo KopaIcon::getIconLike(); ?> </a></li> <?php } ?> </ul> <?php } ?> </header> <div class="widget-content"> <?php $sections = array('latest' => array('id' => $latest_id, 'title' => __('Latest', kopa_get_domain())), 'most-comment' => array('id' => $most_comment_id, 'title' => __('Most comment', kopa_get_domain())), 'most-view' => array('id' => $most_view_id, 'title' => __('Most view', kopa_get_domain())), 'most-like' => array('id' => $most_like_id, 'title' => __('Most like', kopa_get_domain()))); if ($params['is_hide_created_date']) { unset($sections['latest']); } if ($params['is_hide_comments']) { unset($sections['most-comment']); } if ($params['is_hide_views']) { unset($sections['most-view']); } if ($params['is_hide_likes']) { unset($sections['most-like']); } if ($sections) { $is_first = true; foreach ($sections as $key => $section) { if ($is_first) { $section_display = 'block'; $is_first = false; } else { $section_display = 'none'; } ?> <div id="<?php echo $section['id']; ?> " class="section-content" style="display: <?php echo $section_display; ?> " data-type="<?php echo $key; ?> " data-paged="1"> <div class="kp-isotope"> <?php switch ($key) { case 'latest': self::get_latest($query, $params); break; case 'most-comment': self::get_most_comment($query, $params); break; case 'most-view': self::get_most_view($query, $params); break; case 'most-like': self::get_most_like($query, $params); break; } ?> </div> </div> <?php } } ?> <?php if ('true' != $instance['is_hide_loadmore']) { ?> <p class="kplaf_load_more load-more"><span><?php echo KopaIcon::getIcon('fa fa-spinner', 'i'); ?> <?php _e('load more', kopa_get_domain()); ?> </span></p> <?php } ?> </div> <?php echo $after_widget; }