function google_link() { $fields = Kirki::fields()->get_all(); // Early exit if no fields are found. if (!$fields || empty($fields)) { return; } // Get an array of all the google fonts $google_fonts = Kirki::fonts()->get_google_fonts(); $fonts = array(); foreach ($fields as $field) { if (isset($field['output'])) { // Check if this is a font-family control $is_font_family = isset($field['output']['property']) && 'font-family' == $field['output']['property'] ? true : false; // Check if this is a font-weight control $is_font_weight = isset($field['output']['property']) && 'font-weight' == $field['output']['property'] ? true : false; // Check if this is a font subset control $is_font_subset = isset($field['output']['property']) && 'font-subset' == $field['output']['property'] ? true : false; if ($is_font_family || $is_font_weight || $is_font_subset) { // The value of this control $value = kirki_get_option($field['settings_raw']); if ($is_font_family) { $fonts[]['font-family'] = $value; } else { if ($is_font_weight) { $fonts[]['font-weight'] = $value; } else { if ($is_font_subset) { $fonts[]['subsets'] = $value; } } } } } } foreach ($fonts as $font) { if (isset($font['font-family'])) { $font_families = !isset($font_families) ? array() : $font_families; $font_families[] = $font['font-family']; if (Kirki::fonts()->is_google_font($font['font-family'])) { $has_google_font = true; } } if (isset($font['font-weight'])) { $font_weights = !isset($font_weights) ? array() : $font_weights; $font_weights[] = $font['font-weight']; } if (isset($font['subsets'])) { $font_subsets = !isset($font_subsets) ? array() : $font_subsets; $font_subsets[] = $font['subsets']; } } $font_families = !isset($font_families) || empty($font_families) ? false : $font_families; $font_weights = !isset($font_weights) || empty($font_weights) ? '400' : $font_weights; $font_subsets = !isset($font_subsets) || empty($font_subsets) ? 'all' : $font_subsets; if (!isset($has_google_font) || !$has_google_font) { $font_families = false; } return $font_families ? Kirki::fonts()->get_google_font_uri($font_families, $font_weights, $font_subsets) : false; }
public function test_kirki_get_option() { $this->add_theme_mod_field(); $this->assertEquals('foo', kirki_get_option('the_mod_option')); set_theme_mod('the_mod_option', 'bar'); $this->assertEquals('bar', kirki_get_option('the_mod_option')); }
function tg_related_products_args($args) { //Check if display related products $tg_shop_related_products = kirki_get_option('tg_shop_related_products'); if (!empty($tg_shop_related_products)) { $args['posts_per_page'] = 3; // 4 related products $args['columns'] = 3; // arranged in 2 columns } else { $args['posts_per_page'] = 0; } return $args; }
/** * Custom CSS */ function kirki_artOuro_custom_css() { // Early exit if Kirki is not installed if (!function_exists('kirki_get_option')) { return; } // Add custom CSS for layouts $css = ''; if ('full' == kirki_get_option('layout')) { $css .= '#primary{width:100%;}'; } elseif ('left-sidebar' == kirki_get_option('layout')) { $css .= '#primary{float:right;}#secondary{float:left;}'; } wp_add_inline_style('artOuro-style', $css); }
public function test() { $this->assertEquals(kirki_get_option(), Kirki::get_option()); $this->assertEquals(kirki_sanitize_hex('#ffffff'), Kirki_Color::sanitize_hex('#ffffff')); $this->assertEquals(kirki_get_rgb('#ffffff'), Kirki_Color::get_rgb('#ffffff')); $this->assertEquals(kirki_get_rgba('#ffffff'), Kirki_Color::get_rgba('#ffffff')); $this->assertEquals(kirki_get_brightness('#ffffff'), Kirki_Color::get_brightness('#ffffff')); $font_registry = Kirki_Toolkit::fonts(); $this->assertEquals(Kirki_Fonts::get_all_fonts(), $font_registry->get_all_fonts()); $this->assertEquals(Kirki_Fonts::get_font_choices(), $font_registry->get_font_choices()); $this->assertEquals(Kirki_Fonts::is_google_font('foo'), $font_registry->is_google_font('foo')); $this->assertEquals(Kirki_Fonts::get_google_font_uri(array('foo')), $font_registry->get_google_font_uri(array('foo'))); $this->assertEquals(Kirki_Fonts::get_google_font_subsets(), $font_registry->get_google_font_subsets()); $this->assertEquals(Kirki_Fonts::choose_google_font_variants('Roboto'), $font_registry->choose_google_font_variants('Roboto')); $this->assertEquals(Kirki_Fonts::get_standard_fonts(), $font_registry->get_standard_fonts()); $this->assertEquals(Kirki_Fonts::get_font_stack('foo'), $font_registry->get_font_stack('foo')); $this->assertEquals(Kirki_Fonts::sanitize_font_choice('foo'), $font_registry->sanitize_font_choice('foo')); $this->assertEquals(Kirki_Fonts::get_google_fonts(), $font_registry->get_google_fonts()); }
function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) { if ($this->counter == 3) { $tg_retina_logo = kirki_get_option('tg_retina_logo'); if (!empty($tg_retina_logo)) { $output .= '<li class="menu-item menu-item-type-custom menu-item-object-custom" id="menu-item-image" style="display: none !important"> '; $output .= '<a href="' . home_url() . '" style="vertical-align: middle;line-height: 18px;padding-top: 13px;padding-bottom: 13px;">'; $output .= '<img src="' . esc_url($tg_retina_logo) . '" alt="' . esc_attr(get_bloginfo('name')) . '" width="154"/>'; $output .= '</a></li>'; } } $id_field = $this->db_fields['id']; //var_dump($this->counter); if (!empty($children_elements[$element->{$id_field}])) { $element->classes[] = 'arrow'; //enter any classname you like here! } Walker_Nav_Menu::display_element($element, $children_elements, $max_depth, $depth, $args, $output); $this->counter++; }
/** * Display social icons which are set in customizer. */ function gently_social_links() { $links_string = kirki_get_option('social_links'); $links = preg_split('/$\\R?^/m', $links_string); if ($links) { echo '<div class="social-links">'; } foreach ($links as $link) { if (filter_var($link, FILTER_VALIDATE_URL)) { $link = esc_url($link); $color = kirki_get_option('header_icons_color_original') ? 'orig-col' : ''; printf('<a href="%1$s" class="sc-link"> <i class="fa %2$s" aria-hidden="true"></i> <span class="screen-reader-text">%3$s</span> </a>', $link, $color, esc_html__('Social media page', 'gently')); } } if ($links) { echo '</div>'; } }
/** * Add sidebar position classes to body. * * @param array $classes Classes for the body element. * * @return array */ function genlty_sidebar_position($classes) { $sidebar_pos = kirki_get_option('sidebar_position'); if ($sidebar_pos == 'left') { $classes[] = 'sidebar-left'; } else { $classes[] = 'sidebar-right'; } $sidebar_collapse = kirki_get_option('sidebar_collapse'); $sidebar_collapse = explode(',', $sidebar_collapse[0]); if (is_home() && in_array('home', $sidebar_collapse)) { $classes[] = 'sidebar-closed'; } else { if (is_single() && in_array('single', $sidebar_collapse)) { $classes[] = 'sidebar-closed'; } else { if (is_archive() && in_array('archive', $sidebar_collapse)) { $classes[] = 'sidebar-closed'; } } } return $classes; }
/img/logo.svg" alt="Logo" class="logo-img"> </a> </div> <!-- /logo --> <!-- menu para escolher portal --> <ul class="qualPortal"> <li><a href="ingage.guiharrison.com/precon2">Institucional</a></li> <li><a class="current" href="#">Pré-fabricado de concreto</a></li> <li><a href="http://www.meuprecon.com.br">Venda de imóveis</a></li> </ul> <!-- /menu para escolher portal --> <!-- telefone --> <div id="telefoneHead"><h2><span>(31)</span> <?php if (kirki_get_option('telefone')) { echo kirki_get_option('telefone'); } ?> </h2></div> <!-- nav <nav class="nav" role="navigation"> <?php html5blank_nav(); ?> </nav> <!-- /nav --> </div> </div>
function tg_masonry_gallery_func($atts, $content) { extract(shortcode_atts(array('gallery_id' => '', 'layout' => 'wide', 'columns' => 4), $atts)); $images_arr = get_post_meta($gallery_id, 'wpsimplegallery_gallery', true); $images_arr = pp_resort_gallery_img($images_arr); $return_html = ''; $custom_id = time() . rand(); if (!is_numeric($columns)) { $columns = 4; } $wrapper_class = ''; $grid_wrapper_class = ''; $column_class = ''; switch ($columns) { case 2: $wrapper_class = 'two_cols'; $grid_wrapper_class = 'classic2_cols'; $column_class = 'one_half gallery2'; break; case 3: $wrapper_class = 'three_cols'; $grid_wrapper_class = 'classic3_cols'; $column_class = 'one_third gallery3'; break; case 4: $wrapper_class = 'four_cols'; $grid_wrapper_class = 'classic4_cols'; $column_class = 'one_fourth gallery4'; break; } if (!empty($images_arr)) { if ($layout == 'contain') { $return_html .= '<div class="standard_wrapper">'; } $return_html .= '<div id="' . $custom_id . '" class="portfolio_filter_wrapper gallery ' . esc_attr($wrapper_class) . ' ' . esc_attr($layout) . '" data-columns="' . esc_attr($columns) . '">'; wp_enqueue_script("script-gallery-grid" . $custom_id, get_template_directory_uri() . "/templates/script-gallery-grid.php?id=" . $custom_id, false, THEMEVERSION, true); foreach ($images_arr as $key => $image) { $image_url = wp_get_attachment_image_src($image, 'original', true); $small_image_url = wp_get_attachment_image_src($image, 'gallery_masonry', true); $image_caption = get_post_field('post_excerpt', $image); $image_alt = get_post_meta($image, '_wp_attachment_image_alt', true); $tg_lightbox_enable_caption = kirki_get_option('tg_lightbox_enable_caption'); $return_html .= '<div class="element grid ' . esc_attr($grid_wrapper_class) . '">'; $return_html .= '<div class="' . esc_attr($column_class) . ' static filterable gallery_type animated' . esc_attr($key + 1) . '">'; $return_html .= '<a class="fancy-gallery" href="' . esc_url($image_url[0]) . '" '; if (!empty($tg_lightbox_enable_caption)) { $return_html .= 'title="' . esc_attr($image_caption) . '" '; } $return_html .= '>'; $return_html .= '<img src="' . esc_url($small_image_url[0]) . '" alt="' . esc_attr($image_alt) . '"/>'; $return_html .= '</a>'; $return_html .= '</div>'; $return_html .= '</div>'; } $return_html .= '</div>'; if ($layout == 'contain') { $return_html .= '</div>'; } } else { $return_html .= __('Empty gallery item. Please make sure you have upload image to it or check the short code.', PLUGINDOMAIN); } return $return_html; }
//Get portfolio category page template $obj_term = get_term_by('slug', $term, 'portfoliosets'); $term_meta = get_option("taxonomy_term_{$obj_term->term_id}"); $tg_page_template = $term_meta['portfoliosets_template']; if (file_exists(get_template_directory() . "/" . $tg_page_template . ".php")) { get_template_part($tg_page_template); } else { get_template_part("portfolio-2-contained"); } exit; } elseif ($post_type == 'galleries') { //Get gallery category page template $obj_term = get_term_by('slug', $term, 'gallerycat'); $term_meta = get_option("taxonomy_term_{$obj_term->term_id}"); $tg_page_template = $term_meta['gallerycat_template']; if (file_exists(get_template_directory() . "/" . $tg_page_template . ".php")) { get_template_part($tg_page_template); } else { get_template_part("gallery-archive-2-contained"); } exit; } else { //Get archive page layout setting $tg_blog_archive_layout = kirki_get_option('tg_blog_archive_layout'); $located = locate_template($tg_blog_archive_layout . '.php'); if (!empty($located)) { get_template_part($tg_blog_archive_layout); } else { echo 'Error can\'t find page template you selected'; } }
* Get current page id **/ if (!is_null($post) && isset($page_obj->ID)) { $current_page_id = $page_obj->ID; } get_header(); global $page_content_class; $page_content_class = 'wide'; //Include custom header feature get_template_part("/templates/template-header"); ?> <!-- Begin content --> <?php //Get number of portfolios per page $tg_portfolio_items = kirki_get_option('tg_portfolio_items'); //Get all portfolio items for paging global $wp_query; if (is_front_page()) { $paged = get_query_var('page') ? get_query_var('page') : 1; } else { $paged = get_query_var('paged') ? get_query_var('paged') : 1; } $query_string = 'paged=' . $paged . '&orderby=menu_order&order=ASC&post_type=portfolios&numberposts=-1&suppress_filters=0&posts_per_page=' . $tg_portfolio_items; if (!empty($term)) { $ob_term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); $custom_tax = $wp_query->query_vars['taxonomy']; $query_string .= '&posts_per_page=-1&' . $custom_tax . '=' . $term; } query_posts($query_string); //Include project filterable options
<?php header("Content-Type: text/css"); $absolute_path = __FILE__; $path_to_file = explode('wp-content', $absolute_path); $path_to_wp = $path_to_file[0]; require_once $path_to_wp . '/wp-load.php'; //Check if hide portfolio navigation $pp_portfolio_single_nav = get_option('pp_portfolio_single_nav'); if (empty($pp_portfolio_single_nav)) { ?> .portfolio_nav { display:none; } <?php } $tg_fixed_menu = kirki_get_option('tg_fixed_menu'); if (!empty($tg_fixed_menu)) { ?> .top_bar.fixed { position: fixed; animation-name: fadeIn; -webkit-animation-name: fadeIn; animation-duration: 0.5s; -webkit-animation-duration: 0.5s; visibility: visible !important; } <?php } ?> <?php
/** * Get the styles for a single field. */ public function setting_styles($field, $styles = '', $element = '', $property = '', $units = '', $prefix = '', $suffix = '', $callback = false) { $value = kirki_get_option($field['settings_raw']); $value = $callback ? call_user_func($callback, $value) : $value; $element = $prefix . $element; $units = $units . $suffix; // Color controls if ('color' == $field['type']) { $color = Kirki_Color::sanitize_hex($value); $styles[$element][$property] = $color . $units; } elseif ('background' == $field['type']) { if (isset($field['default']['color'])) { $color_mode = false !== strpos($field['default']['color'], 'rgba') ? 'color-alpha' : 'color'; $value = kirki_get_option($field['settings_raw'] . '_color'); if ('color-alpha' == $color_mode) { $bg_color = kirki_sanitize_rgba($value); } else { $bg_color = Kirki_Color::sanitize_hex($value); } } if (isset($field['default']['image'])) { $bg_image = kirki_get_option($field['settings_raw'] . '_image'); $bg_image = esc_url_raw($bg_image); } if (isset($field['default']['repeat'])) { $bg_repeat = kirki_get_option($field['settings_raw'] . '_repeat'); $bg_repeat = kirki_sanitize_bg_repeat($bg_repeat); } if (isset($field['default']['size'])) { $bg_size = kirki_get_option($field['settings_raw'] . '_size'); $bg_size = kirki_sanitize_bg_size($bg_size); } if (isset($field['default']['attach'])) { $bg_attach = kirki_get_option($field['settings_raw'] . '_attach'); $bg_attach = kirki_sanitize_bg_attach($bg_attach); } if (isset($field['default']['position'])) { $bg_position = kirki_get_option($field['settings_raw'] . '_position'); $bg_position = kirki_sanitize_bg_position($bg_position); } if (isset($field['default']['opacity']) && $field['default']['opacity']) { $bg_opacity = kirki_get_option($field['settings_raw'] . '_opacity'); $bg_opacity = kirki_sanitize_number($bg_opacity); if (isset($bg_color)) { // If we're using an opacity other than 100, then convert the color to RGBA. $bg_color = 100 != $bg_opacity ? Kirki_Color::get_rgba($bg_color, $bg_opacity) : $bg_color; } elseif (isset($bg_image)) { $element_opacity = $bg_opacity / 100; } } if (isset($bg_color)) { $styles[$element]['background-color'] = $bg_color . $units; } if (isset($bg_image) && '' != $bg_image) { $styles[$element]['background-image'] = 'url("' . $bg_image . '")' . $units; if (isset($bg_repeat)) { $styles[$element]['background-repeat'] = $bg_repeat . $units; } if (isset($bg_size)) { $styles[$element]['background-size'] = $bg_size . $units; } if (isset($bg_attach)) { $styles[$element]['background-attachment'] = $bg_attach . $units; } if (isset($bg_position)) { $styles[$element]['background-position'] = str_replace('-', ' ', $bg_position) . $units; } } } elseif (array($field['output']) && isset($field['output']['property']) && in_array($field['output']['property'], array('font-family', 'font-size', 'font-weight'))) { $is_font_family = isset($field['output']['property']) && 'font-family' == $field['output']['property'] ? true : false; $is_font_size = isset($field['output']['property']) && 'font-size' == $field['output']['property'] ? true : false; $is_font_weight = isset($field['output']['property']) && 'font-weight' == $field['output']['property'] ? true : false; if ('font-family' == $property) { $styles[$field['output']['element']]['font-family'] = $value . $units; } else { if ('font-size' == $property) { // Get the unit we're going to use for the font-size. $units = empty($units) ? 'px' : $units; $styles[$element]['font-size'] = $value . $units; } else { if ('font-weight' == $property) { $styles[$element]['font-weight'] = $value . $units; } } } } else { $styles[$element][$property] = $value . $units; } return $styles; }
<a class="bg-cor" href="<?php echo esc_url(kirki_get_option('fast_link_2')); ?> "> <?php echo esc_textarea($title); ?> </a> <?php } ?> <?php if ($title = kirki_get_option('fast_link_3_title')) { ?> <a class="bg-cor" href="<?php echo esc_url(kirki_get_option('fast_link_3')); ?> "> <?php echo esc_textarea($title); ?> </a> <?php } ?> </div><!-- .col-md-4 links-rapidos --> <div class="col-md-4 agenda"> <header class="col-md-12"> <h3 class="col-md-6"><?php _e('Agenda de Ações', 'odin'); ?>
<ul class="default-menu"> <?php echo wp_list_pages('title_li='); ?> </ul><!-- default-menu --> <?php } ?> <?php } ?> </div><!-- .row --> </div><!-- .container --> </nav><!-- #menu-top.col-md-12 --> <?php if ($logo = kirki_get_option('logo')) { ?> <div class="col-md-12 col-sm-12 pull-left wrap-logo"> <div class="logo"> <img src="<?php echo esc_url($logo); ?> " alt="<?php bloginfo('name'); ?> " /> </div><!-- .logo --> </div><!-- .col-sm-12 pull-left --> <?php }
function ppb_gallery_archive_func($atts, $content) { //extract short code attr extract(shortcode_atts(array('size' => 'one', 'slug' => '', 'title' => '', 'cat' => '', 'items' => '', 'layout' => 'contain', 'columns' => 3, 'custom_css' => ''), $atts)); if (!is_numeric($items)) { $items = 3; } if (!is_numeric($columns)) { $columns = 3; } $sec_id = ''; if (!empty($slug)) { $sec_id = 'id="' . esc_attr($slug) . '"'; } $return_html = '<div ' . $sec_id . ' class="' . esc_attr($size) . '" '; if (!empty($custom_css)) { $return_html .= 'style="' . urldecode(esc_attr($custom_css)) . '" '; } $return_html .= '>'; //Display galleries items $args = array('numberposts' => $items, 'order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => array('galleries'), 'suppress_filters' => 0); if (!empty($cat)) { $args['gallerycat'] = $cat; } $galleris_arr = get_posts($args); $wrapper_class = ''; $grid_wrapper_class = ''; $column_class = ''; switch ($columns) { case 2: $wrapper_class = 'two_cols'; $grid_wrapper_class = 'classic2_cols'; $column_class = 'one_half gallery2'; break; case 3: $wrapper_class = 'three_cols'; $grid_wrapper_class = 'classic3_cols'; $column_class = 'one_third gallery3'; break; case 4: $wrapper_class = 'four_cols'; $grid_wrapper_class = 'classic4_cols'; $column_class = 'one_fourth gallery4'; break; } if (!empty($galleris_arr) && is_array($galleris_arr)) { if ($layout == 'contain') { $return_html .= '<div class="standard_wrapper">'; } //Check if disable slideshow hover effect $tg_gallery_hover_slide = kirki_get_option("tg_gallery_hover_slide"); if (!empty($tg_gallery_hover_slide)) { wp_enqueue_script("jquery.cycle2.min", get_template_directory_uri() . "/js/jquery.cycle2.min.js", false, THEMEVERSION, true); wp_enqueue_script("custom_cycle", get_template_directory_uri() . "/js/custom_cycle.js", false, THEMEVERSION, true); } //Get random ID for this element $custom_id = time() . rand(); $return_html .= '<div id="' . $custom_id . '" class="portfolio_filter_wrapper gallery ' . esc_attr($wrapper_class) . ' ' . esc_attr($layout) . '" data-columns="' . esc_attr($columns) . '">'; wp_enqueue_script("script-gallery-grid" . $custom_id, get_template_directory_uri() . "/templates/script-gallery-grid.php?id=" . $custom_id, false, THEMEVERSION, true); foreach ($galleris_arr as $key => $gallery) { $image_url = ''; $gallery_ID = $gallery->ID; if (has_post_thumbnail($gallery_ID, 'original')) { $image_id = get_post_thumbnail_id($gallery_ID); $small_image_url = wp_get_attachment_image_src($image_id, 'gallery_grid', true); } $permalink_url = get_permalink($gallery_ID); $return_html .= '<div class="element grid ' . esc_attr($grid_wrapper_class) . '">'; $return_html .= '<div class="' . esc_attr($column_class) . ' static filterable gallery_type animated' . esc_attr($key + 1) . ' archive">'; if (!empty($small_image_url[0])) { $all_photo_arr = array(); if (!empty($tg_gallery_hover_slide)) { //Get gallery images $all_photo_arr = get_post_meta($gallery_ID, 'wpsimplegallery_gallery', true); //Get only 5 recent photos $all_photo_arr = array_slice($all_photo_arr, 0, 5); } $return_html .= '<a href="' . esc_url($permalink_url) . '"><div class="gallery_archive_desc"> <h4>' . $gallery->post_title . '</h4> <div class="post_detail">' . $gallery->post_excerpt . '</div></div>'; if (!empty($all_photo_arr)) { $return_html .= '<ul class="gallery_img_slides">'; foreach ($all_photo_arr as $photo) { $slide_image_url = wp_get_attachment_image_src($photo, 'gallery_grid', true); $return_html .= '<li><img src="' . esc_url($slide_image_url[0]) . '" alt="" class="static"/></li>'; } $return_html .= '</ul>'; } $return_html .= '<img src="' . esc_url($small_image_url[0]) . '" alt="' . esc_attr($gallery->post_title) . '"/></a>'; } $return_html .= '</div>'; $return_html .= '</div>'; } $return_html .= '</div>'; if ($layout == 'contain') { $return_html .= '</div>'; } } $return_html .= '</div>'; return $return_html; }
* Template Name: Gallery Archive 2 Columns Wide * The main template file for display gallery page. * * @package WordPress */ /** * Get Current page object **/ $ob_page = get_page($post->ID); $current_page_id = ''; if (isset($ob_page->ID)) { $current_page_id = $ob_page->ID; } get_header(); //Check if disable slideshow hover effect $tg_gallery_hover_slide = kirki_get_option("tg_gallery_hover_slide"); if (!empty($tg_gallery_hover_slide)) { wp_enqueue_script("jquery.cycle2.min", get_template_directory_uri() . "/js/jquery.cycle2.min.js", false, THEMEVERSION, true); wp_enqueue_script("custom_cycle", get_template_directory_uri() . "/js/custom_cycle.js", false, THEMEVERSION, true); } ?> <?php global $page_content_class; $page_content_class = 'wide'; //Include custom header feature get_template_part("/templates/template-header"); ?> <!-- Begin content --> <?php
echo $text; ?> </p> </div><!-- .col-md-12 --> <?php } ?> <?php if (kirki_get_option('box3_btn_url')) { ?> <a class="btn btn-primary" href="<?php echo esc_url(kirki_get_option('box3_btn_url')); ?> "> <?php echo kirki_get_option('box3_btn'); ?> </a> <?php } ?> </div> </div><!--servicos interno--> <div id="slider"> <h2 class="section-title"> <?php _e('Destaques', 'odin'); ?> </h2><!-- .section-title --> <div class="col-md-12 clear"></div><!-- .col-md-12 clear --> <?php
" width="154" height="59"/> <?php } ?> </a> </div> </div> <?php } ?> <!-- End logo --> </div> <?php //Check if enable main menu $tg_main_menu = kirki_get_option('tg_main_menu'); if (THEMEDEMO && isset($_GET['menu']) && !empty($_GET['menu'])) { $tg_main_menu = false; } if (!empty($tg_main_menu)) { ?> <div id="menu_wrapper"> <div id="nav_wrapper"> <div class="nav_wrapper_inner"> <div id="menu_border_wrapper"> <?php //Check if has custom menu if (is_object($post) && $post->post_type == 'page') { $page_menu = get_post_meta($current_page_id, 'page_menu', true); } if (empty($page_menu)) {
/** * Add the required script. */ function customize_controls_print_footer_scripts() { $fields = Kirki::fields()->get_all(); // Early exit if no controls are defined if (empty($fields)) { return; } $script = ''; foreach ($fields as $field) { $required = isset($field['required']) ? $field['required'] : false; if ($required) { $show = false; foreach ($required as $dependency) { // Find the type of the dependency control $type = $fields[$dependency['setting']]['type']; // If "operator" is not set then set it to "==" if (!isset($dependency['operator'])) { $dependency['operator'] = '=='; } $dependency['operator'] = esc_js($dependency['operator']); // Set the control type $type = 'dropdown-pages' == $type ? 'select' : $type; $type = 'radio-image' == $type ? 'radio' : $type; $type = 'radio-buttonset' == $type ? 'radio' : $type; $type = 'toggle' == $type ? 'checkbox' : $type; $type = 'switch' == $type ? 'checkbox' : $type; // Set the controller used in the script $controller = '#customize-control-' . $dependency['setting'] . ' input'; if ('select' == $type) { $controller = '#customize-control-' . $dependency['setting'] . ' select'; } elseif ('radio' == $type) { $controller = '#customize-control-' . $dependency['setting'] . ' input[value="' . $dependency['value'] . '"]'; } // The target element $target = '#customize-control-' . $field['settings']; // if this is a background control then make sure we target all sub-controls if ('background' == $field['type']) { $target = '#customize-control-' . $control['settings'] . '_color, '; $target .= '#customize-control-' . $control['settings'] . '_image, '; $target .= '#customize-control-' . $control['settings'] . '_repeat, '; $target .= '#customize-control-' . $control['settings'] . '_size, '; $target .= '#customize-control-' . $control['settings'] . '_position, '; $target .= '#customize-control-' . $control['settings'] . '_attach'; } if (!isset($dependency['operator'])) { $dependency['operator'] = '=='; } $action_1 = '.show()'; $action_2 = '.hide()'; // Allow checking both checked and unchecked checkboxes if ('checkbox' == $type) { if (0 == $dependency['value'] && '==' == $dependency['operator']) { $action_1 = '.hide()'; $action_2 = '.show()'; $show = true; } if (1 == $dependency['value'] && '!=' == $dependency['operator']) { $action_1 = '.hide()'; $action_2 = '.show()'; } } // Get the initial status $value = kirki_get_option($field['settings']); if ('==' == $dependency['operator']) { $show = $show && $dependency['value'] == $value ? true : $show; } elseif ('!=' == $dependency['operator']) { $show = $show && $dependency['value'] != $value ? true : $show; } elseif ('>=' == $dependency['operator']) { $show = $show && $dependency['value'] >= $value ? true : $show; } elseif ('<=' == $dependency['operator']) { $show = $show && $dependency['value'] <= $value ? true : $show; } elseif ('>' == $dependency['operator']) { $show = $show && $dependency['value'] > $value ? true : $show; } elseif ('<' == $dependency['operator']) { $show = $show && $dependency['value'] < $value ? true : $show; } // if initial status is hidden then hide the control if (false == $show) { $script .= '$("' . $target . '").hide();'; } $script .= '$("' . $controller . '").'; $script .= 'checkbox' == $type ? 'click' : 'change'; $script .= '(function(){'; $script .= 'if ($("' . $controller . '").'; $script .= 'checkbox' == $type ? 'is(":checked") ) {' : 'val() ' . $dependency['operator'] . ' "' . $dependency['value'] . '") {'; $script .= '$("' . $target . '")' . $action_1 . ';'; $script .= '} else {'; $script .= '$("' . $target . '")' . $action_2 . ';'; $script .= '}});'; $script .= 'checkbox' != $type ? '$("' . $controller . '").trigger("change");' : ''; } } } // If there's a script then echo it wrapped. if (!empty($script)) { echo ScriptRegistry::prepare($script); } }
/** * Get Current page object **/ if (!is_null($post)) { $page_obj = get_page($post->ID); } $current_page_id = ''; /** * Get current page id **/ if (!is_null($post) && isset($page_obj->ID)) { $current_page_id = $page_obj->ID; } get_header(); //Include post featured slider $tg_blog_slider_layout = kirki_get_option('tg_blog_slider_layout'); if (THEMEDEMO && isset($_GET['slider'])) { $tg_blog_slider_layout = $_GET['slider']; } if (!empty($tg_blog_slider_layout)) { get_template_part("/templates/template-" . $tg_blog_slider_layout); } $is_display_page_content = TRUE; $is_standard_wp_post = FALSE; if (is_tag()) { $is_display_page_content = FALSE; $is_standard_wp_post = TRUE; } elseif (is_category()) { $is_display_page_content = FALSE; $is_standard_wp_post = TRUE; } elseif (is_archive()) {
<strong><?php echo esc_html($author_name); ?> </strong><br/> <?php echo esc_html($author_info); ?> </div> </div> </div> <?php } ?> <?php $tg_blog_display_related = kirki_get_option('tg_blog_display_related'); if ($tg_blog_display_related) { ?> <?php //for use in the loop, list 9 post titles related to post's tags on current post $tags = wp_get_post_tags($post->ID); if ($tags) { $tag_in = array(); //Get all tags foreach ($tags as $tags) { $tag_in[] = $tags->term_id; } $args = array('tag__in' => $tag_in, 'post__not_in' => array($post->ID), 'showposts' => 3, 'ignore_sticky_posts' => 1, 'orderby' => 'date', 'order' => 'DESC'); $my_query = new WP_Query($args); $i_post = 1;
function tg_menu_layout() { $tg_menu_layout = kirki_get_option('tg_menu_layout'); if (THEMEDEMO && isset($_GET['menulayout']) && !empty($_GET['menulayout'])) { $tg_menu_layout = $_GET['menulayout']; } return $tg_menu_layout; }
function register_mobile_css() { //Check if enable responsive layout $tg_mobile_responsive = kirki_get_option('tg_mobile_responsive'); if (!empty($tg_mobile_responsive)) { //enqueue frontend css files $pp_advance_combine_css = get_option('pp_advance_combine_css'); if (!empty($pp_advance_combine_css)) { wp_enqueue_style('responsive', get_template_directory_uri() . "/templates/responsive-css.php", false, "", "all"); } else { wp_enqueue_style('responsive', get_template_directory_uri() . "/css/grid.css", false, "", "all"); } } }
//Get page header display setting $page_show_title = get_post_meta($current_page_id, 'page_show_title', true); if (empty($page_show_title)) { //Get current page tagline $page_tagline = get_post_meta($current_page_id, 'page_tagline', true); $pp_page_bg = ''; //Get page featured image if (has_post_thumbnail($current_page_id, 'full')) { $image_id = get_post_thumbnail_id($current_page_id); $image_thumb = wp_get_attachment_image_src($image_id, 'full', true); if (isset($image_thumb[0]) && !empty($image_thumb[0])) { $pp_page_bg = $image_thumb[0]; } } //Check if add blur effect $tg_page_title_img_blur = kirki_get_option('tg_page_title_img_blur'); global $global_pp_topbar; ?> <div id="page_caption" class="<?php if (!empty($pp_page_bg)) { ?> hasbg parallax <?php } ?> <?php if (!empty($global_pp_topbar)) { ?> withtopbar<?php } ?> <?php
<?php //Display top social icons //Check if open link in new window $tg_topbar_social_link = kirki_get_option('tg_topbar_social_link'); ?> <div class="social_wrapper"> <ul> <?php $pp_facebook_url = get_option('pp_facebook_url'); if (!empty($pp_facebook_url)) { ?> <li class="facebook"><a <?php if (!empty($tg_topbar_social_link)) { ?> target="_blank"<?php } ?> href="<?php echo esc_url($pp_facebook_url); ?> "><i class="fa fa-facebook"></i></a></li> <?php } ?> <?php $pp_twitter_username = get_option('pp_twitter_username'); if (!empty($pp_twitter_username)) { ?> <li class="twitter"><a <?php if (!empty($tg_topbar_social_link)) {
?> <!-- Begin content --> <?php ?> <div class="inner"> <div class="inner_wrapper nopadding"> <div id="page_main_content" class="sidebar_content full_width nopadding fixed_column"> <div id="portfolio_filter_wrapper" class="gallery three_cols portfolio-content section content clearfix" data-columns="3"> <?php $tg_full_image_caption = kirki_get_option('tg_full_image_caption'); $counter = rand(0, 2); foreach ($all_photo_arr as $key => $photo_id) { $small_image_url = ''; $image_url = ''; if (!empty($photo_id)) { $image_url = wp_get_attachment_image_src($photo_id, 'original', true); $image_class = ''; switch ($counter) { case 0: $image_class = 'gallery_masonry'; break; case 1: $image_class = 'gallery_masonry1'; break; case 2:
<?php //Get all project service and sorting option $tg_portfolio_filterable = kirki_get_option('tg_portfolio_filterable'); //Get all sets and sorting option $tg_portfolio_filterable_sort = kirki_get_option('tg_portfolio_filterable_sort'); //Check filterable link option $tg_portfolio_filterable_link = kirki_get_option('tg_portfolio_filterable_link'); //Get all portfolio sets $sets_arr = get_terms('portfoliosets', 'hide_empty=0&hierarchical=0&parent=0&orderby=' . $tg_portfolio_filterable_sort); if (!empty($tg_portfolio_filterable) && !empty($sets_arr) && empty($term)) { ?> <ul id="portfolio_wall_filters" class="portfolio-main filter full"> <li class="all-projects active"> <a class="active" href="javascript:;" data-filter="*"><?php echo _e('All', THEMEDOMAIN); ?> </a> <span class="separator">/</span> </li> <?php foreach ($sets_arr as $key => $set_item) { $filter_link_url = 'javascript:;'; if (!empty($tg_portfolio_filterable_link)) { $filter_link_url = get_term_link($set_item); } ?> <li class="cat-item <?php echo esc_attr($set_item->slug); ?> " data-type="<?php
$order = 'DESC'; if (THEMEDEMO) { $order = 'ASC'; } //Get post featured category $query_string = 'orderby=date&order=' . $order . '&post_type=post&suppress_filters=0'; //Check if filter slider posts by selected category $tg_blog_slider_cat = kirki_get_option('tg_blog_slider_cat'); if (THEMEDEMO) { $tg_blog_slider_cat = 9; } if (!empty($tg_blog_slider_cat)) { $query_string .= '&cat=' . $tg_blog_slider_cat; } //Check slider post items $tg_blog_slider_items = kirki_get_option('tg_blog_slider_items'); if (!empty($tg_blog_slider_items) && is_numeric($tg_blog_slider_items)) { $query_string .= '&posts_per_page=' . $tg_blog_slider_items; } else { $query_string .= '&posts_per_page=5'; } query_posts($query_string); wp_enqueue_script("flexslider-js", get_template_directory_uri() . "/js/flexslider/jquery.flexslider-min.js", false, THEMEVERSION, true); wp_enqueue_script("script-gallery-flexslider", get_template_directory_uri() . "/templates/script-slider-flexslider.php", false, THEMEVERSION, true); ?> <div id="post_featured_slider" class="slider_wrapper"> <div class="flexslider" data-height="550"> <ul class="slides"> <?php //Display slide content if (have_posts()) {