tag based on what is being viewed. * * @param string $title Default title text for current view. * @param string $sep Optional separator. * @return string The filtered title. */ function evolve_wp_title( $title, $sep ) { if ( is_feed() ) { return $title; } global $page, $paged; // Add the blog name $title .= get_bloginfo( 'name', 'display' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) { $title .= " $sep $site_description"; } // Add a page number if necessary: if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { $title .= " $sep " . sprintf( __( 'Page %s', '_s' ), max( $paged, $page ) ); } return $title; } add_filter( 'wp_title', 'evolve_wp_title', 10, 2 ); /** * Title shim for sites older than WordPress 4.1. * * @link https://make.wordpress.org/core/2014/10/29/title-tags-in-4-1/ * @todo Remove this function when WordPress 4.3 is released. */ function evolve_render_title() { ?> <?php wp_title( '-', true, 'right' ); ?> 'e5e5e5', 'default-image' => '' ); add_theme_support('custom-background',$defaults); } add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) ); load_theme_textdomain( 'evolve', get_template_directory() . '/languages' ); register_nav_menu( 'primary-menu', __( 'Primary Menu', 'evolve' ) ); $evolve_layout = evolve_get_option('evl_layout','2cr'); $evolve_width_layout = evolve_get_option('evl_width_layout','fixed'); global $content_width; if ($evolve_layout == "2cl" || $evolve_layout == "2cr" ) { if ( ! isset( $content_width ) ) $content_width = 610; } if ( ($evolve_layout == "3cl" || $evolve_layout == "3cr" ) || ($evolve_layout == "3cm" ) ) { if ( ! isset( $content_width ) ) $content_width = 506; } if ( $evolve_layout == "1c" ) { if ( ! isset( $content_width ) ) $content_width = 955; } } add_action( 'after_setup_theme', 'evolve_after_setup' ); /** * bbPress Integration * * * @since 3.1.5 */ /** * Functions - Evolve gatekeeper * * This file defines a few constants variables, loads up the core Evolve file, * and finally initialises the main WP Evolve Class. * * @package EvoLve * @subpackage Functions */ /* Blast you red baron! Initialise WP Evolve */ get_template_part( 'library/evolve' ); WPevolve::init(); get_template_part( 'library/functions/options-backup' ); get_template_part( 'library/functions/tabs-widget' ); /* evolve_truncate */ function evolve_truncate ($str, $length=10, $trailing='..') { $length-=mb_strlen($trailing); if (mb_strlen($str)> $length) { return mb_substr($str,0,$length).$trailing; } else { $res = $str; } return $res; } /* Get first image */ function evolve_get_first_image() { global $post, $posts; $first_img = ''; $output = preg_match_all('//i', $post->post_content, $matches); if(isset($matches[1][0])){ $first_img = $matches [1][0]; return $first_img; } } // Tiny URL function evolve_tinyurl($url) { $response = esc_url(wp_remote_retrieve_body(wp_remote_get('http://tinyurl.com/api-create.php?url='.$url))); return $response; } // Similar Posts function evolve_similar_posts() { $post = ''; $orig_post = $post; global $post; $evolve_similar_posts = get_option('evl_similar_posts','disable'); if ($evolve_similar_posts == "category") { $matchby = get_the_category($post->ID); $matchin = 'category'; } else { $matchby = wp_get_post_tags($post->ID); $matchin = 'tag'; } if ($matchby) { $matchby_ids = array(); foreach($matchby as $individual_matchby) $matchby_ids[] = $individual_matchby->term_id; $args=array( $matchin.'__in' => $matchby_ids, 'post__not_in' => array($post->ID), 'showposts'=>5, // Number of related posts that will be shown. 'ignore_sticky_posts'=>1 ); $my_query = new wp_query($args); if( $my_query->have_posts() ) { echo'
'.__( 'Similar posts', 'evolve' ).'
'; } } $post = $orig_post; wp_reset_query(); } function evolve_footer_hooks() { ?> $v) { $amount = $v / 100; $amount = round($amount * $factor); $new_decimal = $v - $amount; $new_hex_component = dechex($new_decimal); if(strlen($new_hex_component) < 2) { $new_hex_component = "0".$new_hex_component; } $new_hex .= $new_hex_component; } return $new_hex; } function evolve_enqueue_comment_reply() { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'evolve_enqueue_comment_reply' ); // Share This Buttons function evolve_sharethis() { ?>
"; echo " "; } } /* Parallax Slider */ function evolve_parallax() { $imagepathfolder = get_template_directory_uri() . '/library/media/images/'; echo "
"; $evolve_slide_1 = evolve_get_option('evl_show_slide1','1'); $evolve_slide_2 = evolve_get_option('evl_show_slide2','1'); $evolve_slide_3 = evolve_get_option('evl_show_slide3','1'); $evolve_slide_4 = evolve_get_option('evl_show_slide4','1'); $evolve_slide_5 = evolve_get_option('evl_show_slide5','1'); if ($evolve_slide_1 == "1") { $evolve_slide1_title = evolve_get_option('evl_slide1_title','Super Awesome WP Theme');if ($evolve_slide1_title === false) $evolve_slide1_title = ''; $evolve_slide1_desc = evolve_get_option('evl_slide1_desc','Absolutely free of cost theme with amazing design and premium features which will impress your visitors');if ($evolve_slide1_desc === false) $evolve_slide1_desc = ''; $evolve_slide1_button = evolve_get_option('evl_slide1_button','Learn more');if ($evolve_slide1_button === false) $evolve_slide1_button = ''; $evolve_slide1_img = evolve_get_option('evl_slide1_img', $imagepathfolder . 'parallax/6.png');if ($evolve_slide1_img === false) $evolve_slide1_img = ''; echo "
"; echo "

".esc_attr($evolve_slide1_title)."

"; echo "

".esc_attr($evolve_slide1_desc)."

"; echo do_shortcode($evolve_slide1_button); echo "
".$evolve_slide1_title."
"; echo "
"; } if ($evolve_slide_2 == "1") { $evolve_slide2_title = evolve_get_option('evl_slide2_title','Bootstrap and Font Awesome Ready');if ($evolve_slide2_title === false) $evolve_slide2_title = ''; $evolve_slide2_desc = evolve_get_option('evl_slide2_desc','Built-in Bootstrap Elements let you do amazing things with your website');if ($evolve_slide2_desc === false) $evolve_slide2_desc = ''; $evolve_slide2_button = evolve_get_option('evl_slide2_button','Learn more');if ($evolve_slide2_button === false) $evolve_slide2_button = ''; $evolve_slide2_img = evolve_get_option('evl_slide2_img', $imagepathfolder . 'parallax/5.png');if ($evolve_slide2_img === false) $evolve_slide2_img = ''; echo "
"; echo "

".esc_attr($evolve_slide2_title)."

"; echo "

".esc_attr($evolve_slide2_desc)."

"; echo do_shortcode($evolve_slide2_button); echo "
".$evolve_slide2_title."
"; echo "
"; } if ($evolve_slide_3 == "1") { $evolve_slide3_title = evolve_get_option('evl_slide3_title','Easy to use control panel');if ($evolve_slide3_title === false) $evolve_slide3_title = ''; $evolve_slide3_desc = evolve_get_option('evl_slide3_desc','Select of 500+ Google Fonts, choose layout as you need, set up your social links');if ($evolve_slide3_desc === false) $evolve_slide3_desc = ''; $evolve_slide3_button = evolve_get_option('evl_slide3_button','Learn more');if ($evolve_slide3_button === false) $evolve_slide3_button = ''; $evolve_slide3_img = evolve_get_option('evl_slide3_img', $imagepathfolder . 'parallax/4.png');if ($evolve_slide3_img === false) $evolve_slide3_img = ''; echo "
"; echo "

".esc_attr($evolve_slide3_title)."

"; echo "

".esc_attr($evolve_slide3_desc)."

"; echo do_shortcode($evolve_slide3_button); echo "
".$evolve_slide3_title."
"; echo "
"; } if ($evolve_slide_4 == "1") { $evolve_slide4_title = evolve_get_option('evl_slide4_title','Fully responsive theme');if ($evolve_slide4_title === false) $evolve_slide4_title = ''; $evolve_slide4_desc = evolve_get_option('evl_slide4_desc','Adaptive to any screen depending on the device being used to view the site');if ($evolve_slide4_desc === false) $evolve_slide4_desc = ''; $evolve_slide4_button = evolve_get_option('evl_slide4_button','Learn more');if ($evolve_slide4_button === false) $evolve_slide4_button = ''; $evolve_slide4_img = evolve_get_option('evl_slide4_img', $imagepathfolder . 'parallax/1.png');if ($evolve_slide4_img === false) $evolve_slide4_img = ''; echo "
"; echo "

".esc_attr($evolve_slide4_title)."

"; echo "

".esc_attr($evolve_slide4_desc)."

"; echo do_shortcode($evolve_slide4_button); echo "
".$evolve_slide4_title."
"; echo "
"; } if ($evolve_slide_5 == "1") { $evolve_slide5_title = evolve_get_option('evl_slide5_title','Unlimited color schemes');if ($evolve_slide5_title === false) $evolve_slide5_title = ''; $evolve_slide5_desc = evolve_get_option('evl_slide5_desc','Upload your own logo, change background color or images, select links color which you love - it\'s limitless');if ($evolve_slide5_desc === false) $evolve_slide5_desc = ''; $evolve_slide5_button = evolve_get_option('evl_slide5_button','Learn more');if ($evolve_slide5_button === false) $evolve_slide5_button = ''; $evolve_slide5_img = evolve_get_option('evl_slide5_img', $imagepathfolder . 'parallax/3.png');if ($evolve_slide5_img === false) $evolve_slide5_img = ''; echo "
"; echo "

".esc_attr($evolve_slide5_title)."

"; echo "

".esc_attr($evolve_slide5_desc)."

"; echo do_shortcode($evolve_slide5_button); echo "
".$evolve_slide5_title."
"; echo "
"; } echo "
"; } /* Front Page Content Boxes */ function evolve_content_boxes() { $evolve_content_boxes = evolve_get_option('evl_content_boxes','1'); $evolve_content_box1_enable = evolve_get_option('evl_content_box1_enable', '1');if ( $evolve_content_box1_enable === false) $evolve_content_box1_enable =''; $evolve_content_box2_enable = evolve_get_option('evl_content_box2_enable', '1');if ( $evolve_content_box2_enable === false) $evolve_content_box2_enable =''; $evolve_content_box3_enable = evolve_get_option('evl_content_box3_enable', '1');if ( $evolve_content_box3_enable === false) $evolve_content_box3_enable =''; $evolve_content_box4_enable = evolve_get_option('evl_content_box4_enable', '1');if ( $evolve_content_box4_enable === false) $evolve_content_box4_enable =''; if ($evolve_content_boxes == "1") { echo "
"; $evolve_content_box1_title = evolve_get_option('evl_content_box1_title','Beautifully Simple');if ($evolve_content_box1_title === false) $evolve_content_box1_title = ''; $evolve_content_box1_desc = evolve_get_option('evl_content_box1_desc','Clean and modern theme with smooth and pixel perfect design focused on details');if ($evolve_content_box1_desc === false) $evolve_content_box1_desc = ''; $evolve_content_box1_button = evolve_get_option('evl_content_box1_button','Learn more');if ($evolve_content_box1_button === false) $evolve_content_box1_button = ''; $evolve_content_box1_icon = evolve_get_option('evl_content_box1_icon', 'fa-cube');if ($evolve_content_box1_icon === false) $evolve_content_box1_icon = ''; /** * Count how many boxes are enabled on frontpage * Apply proper responsivity class * * @since 3.1.5 */ $BoxCount = 0; // Box Counter if( $evolve_content_box1_enable == true ) $BoxCount++; if( $evolve_content_box2_enable == true ) $BoxCount++; if( $evolve_content_box3_enable == true ) $BoxCount++; if( $evolve_content_box4_enable == true ) $BoxCount++; switch( $BoxCount ): case $BoxCount == 1: $BoxClass = 'col-md-12'; break; case $BoxCount == 2: $BoxClass = 'col-md-6'; break; case $BoxCount == 3: $BoxClass = 'col-md-4'; break; case $BoxCount == 4: $BoxClass = 'col-md-3'; break; default: $BoxClass = 'col-md-3'; endswitch; if( $evolve_content_box1_enable == true ) { echo "
"; echo ""; echo "

".esc_attr($evolve_content_box1_title)."

"; echo "

".do_shortcode($evolve_content_box1_desc)."

"; echo do_shortcode($evolve_content_box1_button); echo "
"; } $evolve_content_box2_title = evolve_get_option('evl_content_box2_title','Easy Customizable');if ($evolve_content_box2_title === false) $evolve_content_box2_title = ''; $evolve_content_box2_desc = evolve_get_option('evl_content_box2_desc','Over a hundred theme options ready to make your website unique');if ($evolve_content_box2_desc === false) $evolve_content_box2_desc = ''; $evolve_content_box2_button = evolve_get_option('evl_content_box2_button','Learn more');if ($evolve_content_box2_button === false) $evolve_content_box2_button = ''; $evolve_content_box2_icon = evolve_get_option('evl_content_box2_icon', 'fa-circle-o-notch');if ($evolve_content_box2_icon === false) $evolve_content_box2_icon = ''; if( $evolve_content_box2_enable == true ) { echo "
"; echo ""; echo "

".esc_attr($evolve_content_box2_title)."

"; echo "

".do_shortcode($evolve_content_box2_desc)."

"; echo do_shortcode($evolve_content_box2_button); echo "
"; } $evolve_content_box3_title = evolve_get_option('evl_content_box3_title','Contact Form Ready');if ($evolve_content_box3_title === false) $evolve_content_box3_title = ''; $evolve_content_box3_desc = evolve_get_option('evl_content_box3_desc','Built-In Contact Page with Google Maps is a standard for this theme');if ($evolve_content_box3_desc === false) $evolve_content_box3_desc = ''; $evolve_content_box3_button = evolve_get_option('evl_content_box3_button','Learn more');if ($evolve_content_box3_button === false) $evolve_content_box3_button = ''; $evolve_content_box3_icon = evolve_get_option('evl_content_box3_icon', 'fa-send');if ($evolve_content_box3_icon === false) $evolve_content_box3_icon = ''; if( $evolve_content_box3_enable == true ) { echo "
"; echo ""; echo "

".esc_attr($evolve_content_box3_title)."

"; echo "

".do_shortcode($evolve_content_box3_desc)."

"; echo do_shortcode($evolve_content_box3_button); echo "
"; } $evolve_content_box4_title = evolve_get_option('evl_content_box4_title','Responsive Blog');if ($evolve_content_box4_title === false) $evolve_content_box4_title = ''; $evolve_content_box4_desc = evolve_get_option('evl_content_box4_desc','Up to 3 Blog Layouts, Bootstrap 3 ready, responsive on all media devices');if ($evolve_content_box4_desc === false) $evolve_content_box4_desc = ''; $evolve_content_box4_button = evolve_get_option('evl_content_box4_button','Learn more');if ($evolve_content_box4_button === false) $evolve_content_box4_button = ''; $evolve_content_box4_icon = evolve_get_option('evl_content_box4_icon', 'fa-tablet');if ($evolve_content_box4_icon === false) $evolve_content_box4_icon = ''; if( $evolve_content_box4_enable == true ) { echo "
"; echo ""; echo "

".esc_attr($evolve_content_box4_title)."

"; echo "

".do_shortcode($evolve_content_box4_desc)."

"; echo do_shortcode($evolve_content_box4_button); echo "
"; } echo "
"; } } class evolve_ThemeFrameworkMetaboxes { public function __construct() { global $data; $this->data = $data; add_action('add_meta_boxes', array($this, 'evolve_add_meta_boxes')); add_action('save_post', array($this, 'evolve_save_meta_boxes')); } public function evolve_add_meta_boxes() { $this->evolve_add_meta_box('evolve_post_options', 'Post Options', 'post'); $this->evolve_add_meta_box('evolve_page_options', 'Page Options', 'page'); } public function evolve_add_meta_box($id, $label, $post_type) { add_meta_box( 'evolve_' . $id, $label, array($this, $id), $post_type ); } public function evolve_save_meta_boxes($post_id) { if(defined( 'DOING_AUTOSAVE') && DOING_AUTOSAVE) { return; } foreach($_POST as $key => $value) { if(strstr($key, 'evolve_')) { update_post_meta($post_id, $key, $value); } } } public function evolve_post_options() { $data = $this->data; require_once( get_template_directory() . '/library/functions/page_options.php' ); } public function evolve_page_options() { require_once( get_template_directory() . '/library/functions/page_options.php' ); } public function evolve_select($id, $label, $options, $desc = '') { global $post; $html = ''; $html .= '
'; $html .= ''; $html .= '
'; $html .= ''; if($desc) { $html .= '

' . $desc . '

'; } $html .= '
'; $html .= '
'; echo $html; } } $metaboxes = new evolve_ThemeFrameworkMetaboxes; /** * evolve_Walker_Nav_Menu */ class evolve_Walker_Nav_Menu extends Walker_Nav_Menu { /** * @see Walker::start_lvl() * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param int $depth Depth of page. Used for padding. */ /** * @see Walker::start_el() * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param int $current_page Menu item ID. * @param object $args */ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; /** * Dividers, Headers or Disabled * ============================= * Determine whether the item is a Divider, Header, Disabled or regular * menu item. To prevent errors we use the strcasecmp() function to so a * comparison that is not case sensitive. The strcasecmp() function returns * a 0 if the strings are equal. */ $class_names = $value = ''; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $classes[] = 'menu-item-' . $item->ID; $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) ); if ( $args->has_children ) $class_names .= ' dropdown'; if ( in_array( 'current-menu-item', $classes ) ) $class_names .= ' active'; $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args ); $id = $id ? ' id="' . esc_attr( $id ) . '"' : ''; $output .= $indent . ''; /** * PolyLang Broken Flag Images - Fix * ================================= * @by jerry * @since 3.2.0 * @todo find better solution */ $item->title_2 = $item->title; // Let's take flag image if( class_exists( 'Polylang' ) ) { if( preg_match( '/title ) ) { $item->title = strip_tags( $item->title ); // Let's remove flag image } } $atts = array(); $atts['title'] = ! empty( $item->title ) ? $item->title : ''; $atts['target'] = ! empty( $item->target ) ? $item->target : ''; $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : ''; $atts['href'] = ! empty( $item->url ) ? $item->url : ''; $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args ); $attributes = ''; foreach ( $atts as $attr => $value ) { if ( ! empty( $value ) ) { $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value ); $attributes .= ' ' . $attr . '="' . $value . '"'; } } $item_output = $args->before; /* * Glyphicons * =========== * Since the the menu item is NOT a Divider or Header we check the see * if there is a value in the attr_title property. If the attr_title * property is NOT null we apply it as the class name for the glyphicon. */ if(evolve_get_option('evl_main_menu_hover_effect','0')==1) $item_output .= ''; else $item_output .= ''; $item_output .= $args->link_before . apply_filters( 'the_title', $item->title_2, $item->ID ) . $args->link_after; $item_output .= ( $args->has_children && 0 === $depth ) ? ' ' : ''; if(evolve_get_option('evl_main_menu_hover_effect','0')==1) $item_output .= ''; else $item_output .= ''; $item_output .= $args->after; $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); } /** * Traverse elements to create list from elements. * * Display one element if the element doesn't have any children otherwise, * display the element and its children. Will only traverse up to the max * depth and no ignore elements under that depth. * * This method shouldn't be called directly, use the walk() method instead. * * @see Walker::start_el() * @since 2.5.0 * * @param object $element Data object * @param array $children_elements List of elements to continue traversing. * @param int $max_depth Max depth to traverse. * @param int $depth Depth of current element. * @param array $args * @param string $output Passed by reference. Used to append additional content. * @return null Null on failure with no changes to parameters. */ public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) { if ( ! $element ) return; $id_field = $this->db_fields['id']; // Display this element. if ( is_object( $args[0] ) ) $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] ); parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); } } // Breadcrumbs // function evolve_breadcrumb() { global $data,$post; if ( !is_front_page() ) { echo '"; } } function evolve_posts_slider() { ?>
'; } else { $image = evolve_get_first_image(); if ($image): echo ''; endif; } ?>

', ']]>', $postexcerpt); $postexcerpt = strip_tags($postexcerpt); $postexcerpt = strip_shortcodes($postexcerpt); echo evolve_truncate($postexcerpt, 180, ' [...]'); ?>

  • Oops, no posts to display! Please check your post slider Category (ID) settings', 'evolve' ); ?>
  • '; echo ' var ias = jQuery.ias({ container: "#primary", item: ".post", pagination: ".navigation-links", next: ".nav-previous a", }); ias.extension(new IASTriggerExtension({ text: "Load more items", offset: 99999 })); ias.extension(new IASSpinnerExtension({ src: "'.get_template_directory_uri().'/library/media/images/loader.gif" })); ias.extension(new IASNoneLeftExtension()); '; echo ''; } }