<repo_name>JSDiez/ThemePRO<file_sep>/js/onetone.js
 //top menu
jQuery(".site-navbar,.home-navbar").click(function(){
				jQuery(".top-nav").toggle();
			});
	
  jQuery('.top-nav ul li').hover(function(){
	jQuery(this).find('ul:first').slideDown(100);
	jQuery(this).addClass("hover");
	},function(){
	jQuery(this).find('ul').css('display','none');
	jQuery(this).removeClass("hover");
	});
  jQuery('.top-nav li ul li:has(ul)').find("a:first").append(" <span class='menu_more'>»</span> ");
 
   jQuery(".top-nav > ul > li,.main-nav > li").click(function(){
	jQuery(".top-nav > ul > li,.main-nav > li").removeClass("active");
	jQuery(this).addClass("active");
    });
   
   //
     ////
  var windowWidth = jQuery(window).width(); 
  if(windowWidth > 939){
	  if(jQuery(".site-main .sidebar").height() > jQuery(".site-main .main-content").height()){
		  jQuery(".site-main .main-content").css("height",(jQuery(".site-main .sidebar").height()+140)+"px");
		  }
	}else{
		jQuery(".site-main .main-content").css("height","auto");
		}
	jQuery(window).resize(function() {
	var windowWidth = jQuery(window).width(); 
	 if(windowWidth > 939){
	  if(jQuery(".site-main .sidebar").height() > jQuery(".site-main .main-content").height()){
		  jQuery(".site-main .main-content").css("height",(jQuery(".site-main .sidebar").height()+140)+"px");
		  }
	}		else{
		jQuery(".site-main .main-content").css("height","auto");
		}	
		
		if(windowWidth > 919){
			jQuery(".top-nav").show();
		}else{
			jQuery(".top-nav").hide();
			}
		
  });

// sticky menu

(function($){
	$.fn.sticky = function( options ) {
		// adding a class to users div
		$(this).addClass('sticky-header');
		var settings = $.extend({
            'scrollSpeed '  : 500
            }, options);


   ////// get homepage sections
	var sections = [];
				jQuery(".top-nav .onetone-menuitem > a").each(function() {
				linkHref =  $(this).attr('href').split('#')[1];
				$target =  $('#' + linkHref);
 
				if($target.length) {
					topPos = $target.offset().top;
					sections[linkHref] = Math.round(topPos);
				
					
				}
			});
				
		//////////		
				
		return $('.sticky-header .home-navigation ul li.onetone-menuitem a').each( function() {
			
			if ( settings.scrollSpeed ) {

				var scrollSpeed = settings.scrollSpeed

			}
			
			
			  if( $("body.admin-bar").length){
		if( $(window).width() < 765) {
				stickyTop = 46;
				
			} else {
				stickyTop = 32;
			}
	  }
	  else{
		  stickyTop = 0;
		  }
		  $(this).css({'top':stickyTop});

			var stickyMenu = function(){

				var scrollTop = $(window).scrollTop(); 
				if (scrollTop > 111) { 
					$('.sticky-header').css({ 'position': 'fixed'}).addClass('fxd');
					} else {
						$('.sticky-header').css({ 'position': 'static' }).removeClass('fxd'); 
					}   
					
			//// set nav menu active status
			var returnValue = null;
			var windowHeight = Math.round($(window).height() * 0.3);

			for(var section in sections) {
				
				if((sections[section] - windowHeight) < scrollTop) {
					position = section;
					
				}
			}
			 
          if( typeof position !== "undefined" && position !== null ) {
			 
				jQuery(".home-navigation .onetone-menuitem ").removeClass("current");
			    jQuery(".home-navigation .onetone-menuitem ").find('a[href$="#' + position + '"]').parent().addClass("current");;
		  }

        ////
			};
			stickyMenu();
			$(window).scroll(function() {
				 stickyMenu();
			});
			  $(this).on('click', function(e){
				var selectorHeight = $('.sticky-header').height();   
				e.preventDefault();
		 		var id = $(this).attr('href');
				if(typeof $('section'+ id).offset() !== 'undefined'){
				if( $("header").css("position") === "static")
				goTo = $(id).offset().top  - 2*selectorHeight;
				else
				 goTo = $(id).offset().top - selectorHeight;
				 
				$("html, body").animate({ scrollTop: goTo }, scrollSpeed);
				}

			});	
					
		});

	}

})(jQuery);


jQuery(document).ready(function($){
								

//slider

 if(jQuery("section.homepage-slider .item").length >1 ){
 jQuery("#onetone-owl-slider").owlCarousel({
	navigation : false, // Show next and prev buttons
	slideSpeed : 300,
	items:1,
	autoplay:true,
	margin:0,
	loop:true,
	paginationSpeed : 400,
	singleItem:true,
	autoplayTimeout:parseInt(onetone_params.slideSpeed)
 
});
}
 if(jQuery("section.homepage-slider .item").length ==1 ){
	 jQuery("section.homepage-slider .owl-carousel").show();
 }


								
 $(".site-nav-toggle").click(function(){
                $(".site-nav").toggle();
            });
 // retina logo
if( window.devicePixelRatio > 1 ){
	if($('.normal_logo').length && $('.retina_logo').length){
		$('.normal_logo').hide();
		$('.retina_logo').show();
		}
	//
	$('.page-title-bar').addClass('page-title-bar-retina');
	
	}
	
//video background
								
 var myPlayer;
        $(function () {
             myPlayer = $("#onetone-youtube-video").YTPlayer();
        });
 
// BACK TO TOP 											
 $(window).scroll(function(){
		if($(window).scrollTop() > 300){
			$("#back-to-top").fadeIn(200);
		} else{
			$("#back-to-top").fadeOut(200);
		}
	});
	
  	$('#back-to-top, .back-to-top').click(function() {
		  $('html, body').animate({ scrollTop:0 }, '800');
		  return false;
	});
	
/* ------------------------------------------------------------------------ */
/* parallax background image 										  	    */
/* ------------------------------------------------------------------------ */
 $('.onetone-parallax').parallax("50%", 0.1);

// parallax scrolling
if( $('.parallax-scrolling').length ){
	$('.parallax-scrolling').parallax({speed : 0.15});
	}
	
//woocommerce
$(document).on('click','.onetone-quantity .minus',function(){
 var qtyWrap  = $(this).parent('.quantity');
 var quantity =  parseInt(qtyWrap.find('.qty').val());
 var min_num  =  parseInt(qtyWrap.find('.qty').attr('min'));
 var max_num  =  parseInt(qtyWrap.find('.qty').attr('max'));
 var step     =  parseInt(qtyWrap.find('.qty').attr('step'));
 $('input[name="update_cart"]').removeAttr("disabled");
 if( quantity > min_num){
	 quantity = quantity - step;
	 if( quantity > 0 )
	 qtyWrap.find('.qty').val(quantity);
	 }
  });
$(document).on('click','.onetone-quantity .plus',function(){
  var qtyWrap  = $(this).parent('.quantity');
  var quantity =  parseInt(qtyWrap.find('.qty').val());
  var min_num  =  parseInt(qtyWrap.find('.qty').attr('min'));
  var max_num  =  parseInt(qtyWrap.find('.qty').attr('max'));
  var step     =  parseInt(qtyWrap.find('.qty').attr('step'));
  $('input[name="update_cart"]').removeAttr("disabled");
 if( max_num ){
	 if( quantity < max_num ){
	 quantity = quantity + step;
	 qtyWrap.find('.qty').val(quantity);
	  }
	 }else{
		 quantity = quantity + step;
		qtyWrap.find('.qty').val(quantity); 
		 }
  });

$('.variations_form .single_add_to_cart_button').prepend('<i class="fa fa-shopping-cart"></i> ');
/* ------------------------------------------------------------------------ */
/*  sticky header             	  								  	    */
/* ------------------------------------------------------------------------ */
	
jQuery(window).scroll(function(){
							   
		if( jQuery("body.admin-bar").length ){
      if( jQuery(window).width() < 765 ) {
          stickyTop = 46;
        } else {
          stickyTop = 32;
        }
    }else{
		        stickyTop = 0;
		}
  
    var scrollTop = $(window).scrollTop(); 
    if (scrollTop > 200) { 
      $('.fxd-header').css({'top':stickyTop}).show();
      $('header').addClass('fixed-header');
    }else{
      $('.fxd-header').hide();
      $('header').removeClass('fixed-header');
    }
 });
 

	
	
// scheme
 if( typeof onetone_params.primary_color !== 'undefined' && onetone_params.primary_color !== '' ){
 less.modifyVars({
        '@color-main': onetone_params.primary_color
    });
   }
   
/* ------------------------------------------------------------------------ */
/*  sticky header             	  								  	    */
/* ------------------------------------------------------------------------ */
 $(document).on('click',"header .main-header .site-nav ul a[href^='#'],a.scroll,.onetone-nav a[href^='#']", function(e){
				if($("body.admin-bar").length){
				  if($(window).width() < 765) {
						  stickyTop = 46;
						  
					  } else {
						  stickyTop = 32;
					  }
				}
				else{
						  stickyTop = 0;
					}
					
						var selectorHeight = 0;
                if( $('.fxd-header').length )
			    var selectorHeight = $('.fxd-header').height();  
				
				if($(window).width() <= 919) {
					$(".site-nav").hide();
					}
								
				var scrollTop = $(window).scrollTop(); 
				e.preventDefault();
		 		var id = $(this).attr('href');
				if(typeof $(id).offset() !== 'undefined'){
				     var goTo = $(id).offset().top - 2*selectorHeight - stickyTop  + 1;
				     $("html, body").animate({ scrollTop: goTo }, 1000);
				}

			});	
$('header .fxd-header .site-nav ul').onePageNav({filter: 'a[href^="#"]',scrollThreshold:0.3});	

 /* ------------------------------------------------------------------------ */
/*  smooth scrolling  btn       	  								  	    */
/* ------------------------------------------------------------------------ */

  $("div.page a[href^='#'],div.post a[href^='#'],div.home-wrapper a[href^='#'],.banner-scroll a[href^='#'], .go-to-item").on('click', function(e){
				var selectorHeight = $('header').height();   
				var scrollTop = $(window).scrollTop(); 
				e.preventDefault();
		 		var id = $(this).attr('href');
				if(typeof $(id).offset() !== 'undefined'){
				var goTo = $(id).offset().top - selectorHeight;
				$("html, body").animate({ scrollTop: goTo }, 1000);
				}

			});	
  
  
 //portfolio carousel
  if($("#related-portfolio").length){
 $("#related-portfolio").owlCarousel({
	navigation : false, // Show next and prev buttons
	pagination: false,
	items:4,
	slideSpeed : 300,
	paginationSpeed : 400,
	singleItem:false,
	autoPlay:parseInt(onetone_params.slideSpeed)
 
});
 }
 
 
 // portfolio filter

jQuery(function ($) {
    
    var filterList = {
    
        init: function () {
        
            // MixItUp plugin
            // http://mixitup.io
            $('.portfolio-list-filter .portfolio-list-items').mixitup({
                targetSelector: '.portfolio-box-wrap',
                filterSelector: '.filter',
                effects: ['fade'],
                easing: 'snap',
                // call the hover effect
                onMixEnd: filterList.hoverEffect()
            });                
        
        },
        
        hoverEffect: function () {             
        
        }
    };
    
    // Run the show!
    filterList.init();
	
    
});        



  $('iframe').each(function(){
							
		if( typeof $(this).attr('width') !=='undefined' && typeof $(this).attr('height') !=='undefined'){
			if( $(this).attr('width') > $(this).outerWidth() ){
			var iframe_height =  $(this).attr('height')*$(this).outerWidth()/$(this).attr('width');
			
			$(this).css({'height':iframe_height});
			
			}
			}
		
		});

   //shop carousel
  
if($(".woocommerce.single-product .thumbnails").length){
 $(".woocommerce.single-product .thumbnails").owlCarousel({
	navigation : true, // Show next and prev buttons
	pagination: false,
	items:4,
	navigationText : ['<i class="fa fa-angle-double-left"></i>', '<i class="fa fa-angle-double-right"></i>'],
	slideSpeed : 300,
	paginationSpeed : 400,
	singleItem:false
	
 
});
 }
 
 //woo

$(".product-image").each(function() {
               $(this).hover(function() {
                 if($(this).find('.product-image-back img').length){
					   $(this).find('.product-image-front').css({'opacity':'0'});
					 }
               },
           function() {
               $(this).find('.product-image-front').css({'opacity':'1'});
           });
           });

 //masonry
 // portfolio
 $('.onetone-masonry').masonry({
 // options
                itemSelector : '.portfolio-box-wrap'
            });
 // blog
 $('.blog-grid').masonry({
 // options
                itemSelector : '.entry-box-wrap'
            });

 var timeline_row_width;
 $('.magee-blog .blog-timeline-wrap .entry-box-wrap').each(function(){
	
	var wrap_width = $(this).parents('.blog-timeline-wrap').innerWidth();
	 timeline_row_width = timeline_row_width+$(this).outerWidth();
	
	if( 2*timeline_item_width >= wrap_width){
		  $(this).removeClass('timeline-left').addClass('timeline-right');
		}else{
		  $(this).removeClass('timeline-right').addClass('timeline-left');	
 }
 });
	
 
  //prettyPhoto
 
 $("a[rel^='portfolio-image']").prettyPhoto();	 
 
 // gallery lightbox
 $(".gallery .gallery-item a").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true});
  



/* ------------------------------------------------------------------------ */
/* parallax background image 										  	    */
/* ------------------------------------------------------------------------ */
 $('.onetone-parallax').parallax("50%", 0.1);
	 
/* ------------------------------------------------------------------------ */
/*  Section Heading Color													*/
/* ------------------------------------------------------------------------ */
	 
 $('section').each(function(){
					var headingcolor = $(this).data("headingcolor");
					if(headingcolor != ""){
						$(this).find("h1,h2,h3,h4,h5,h6").css("color",headingcolor);
						}
				});
 
  $(".section-banner").each(function(){
  var videoHeight =$(window).height();
  if( typeof onetone_params.header_cover_video_background !== 'undefined' && onetone_params.header_cover_video_background == '0'){
  var videoHeight = videoHeight-$('.sticky-header').height();
  }
  if( typeof onetone_video !== 'undefined' && typeof onetone_video.header_cover_video_background_html5 !== 'undefined' && onetone_video.header_cover_video_background_html5 == '0'){
	  
  var videoHeight = videoHeight-$('.sticky-header').height();
  $(this).find("#big-video-wrap").css({"position":"absolute"});
  
  }
  $(this).css({"min-height":videoHeight});
  $(this).find("#tubular-container,#big-video-vid").css({"height":videoHeight});
  
  });
 //
  if($(window).width() <1200){	
						  newPercentage = (($(window).width() / 1200) * 100) + "%";
						  $(".home-banner .heading-inner").css({"font-size": newPercentage});
						  }	
 $(window).on("resize", function (){
	if($(window).width() <1200){
	newPercentage = (($(window).width() / 1200) * 100) + "%";
	$(".home-banner .heading-inner").css({"font-size": newPercentage});
	}else{
	$(".home-banner .heading-inner").css({"font-size": "100%"});
	}
	
 });
 
 // section fullheight
	var win_height = $(window).height();
  
	$("section.fullheight").each(function(){
         var section_height = $(this).height();
    		if($(this).is('#home-header')) {
					var win_height = $(window).height();
  				var navBar_height = $('.top-wrap').height();
          var win_height = win_height - navBar_height;
        }
		 $(this).css({'height':section_height,'min-height':win_height});
     });
	

 });


if(jQuery().waypoint && jQuery(window).width() > 919 ) {								  
    jQuery('.onetone-animated').each(function(){
			 if(jQuery(this).data('imageanimation')==="yes"){
		         jQuery(this).find("img,i.fa").css("visibility","hidden");	
		 }
		 else{
	           jQuery(this).css("visibility","hidden");	
		 }		
		 
	 });
		
}

/* ------------------------------------------------------------------------ */
/*  home page animation													*/
/* ------------------------------------------------------------------------ */

function onetone_animation(e){
	
	e.css({'visibility':'visible'});
			e.find("img,i.fa").css({'visibility':'visible'});	

			// this code is executed for each appeared element
			var animation_type       = e.data('animationtype');
			var animation_duration   = e.data('animationduration');
	        var image_animation      = e.data('imageanimation');
			 if(image_animation === "yes"){
						 
			e.find("img,i.fa").addClass("animated "+animation_type);

			if(animation_duration) {
				e.find("img,i.fa").css('-moz-animation-duration', animation_duration+'s');
				e.find("img,i.fa").css('-webkit-animation-duration', animation_duration+'s');
				e.find("img,i.fa").css('-ms-animation-duration', animation_duration+'s');
				e.find("img,i.fa").css('-o-animation-duration', animation_duration+'s');
				e.find("img,i.fa").css('animation-duration', animation_duration+'s');
			}
			
				 
			 }else{
			e.addClass("animated "+animation_type);

			if(animation_duration) {
				e.css('-moz-animation-duration', animation_duration+'s');
				e.css('-webkit-animation-duration', animation_duration+'s');
				e.css('-ms-animation-duration', animation_duration+'s');
				e.css('-o-animation-duration', animation_duration+'s');
				e.css('animation-duration', animation_duration+'s');
			}
			 }
	
	
	}

jQuery(window).load(function ($){ 
jQuery('.onetone-animated').each(function(){
  if( jQuery(window).height() > jQuery(this).offset().top){
   onetone_animation(jQuery(this));
  }
 });
 });

 var animated = false;
 jQuery(window).scroll(function () {
if(jQuery(window).width() > 919 ){
		
if(jQuery().waypoint && animated == false ) {								  

		jQuery('.onetone-animated').waypoint(function() {onetone_animation(jQuery(this));},{ triggerOnce: true, offset: '90%' });
	}
   animated = true;
	}
 });



/*
Plugin: jQuery Parallax
Version 1.1.3
Author: <NAME>
Twitter: @IanLunn
Author URL: http://www.ianlunn.co.uk/
Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/

Dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html
*/

(function( $ ){
	var $window = $(window);
	var windowHeight = $window.height();

	$window.resize(function () {
		windowHeight = $window.height();
	});

	$.fn.parallax = function(xpos, speedFactor, outerHeight) {
		var $this = $(this);
		var getHeight;
		var firstTop;
		var paddingTop = 0;
		
		//get the starting position of each element to have parallax applied to it		
		$this.each(function(){
		    firstTop = $this.offset().top;
		});

		if (outerHeight) {
			getHeight = function(jqo) {
				return jqo.outerHeight(true);
			};
		} else {
			getHeight = function(jqo) {
				return jqo.height();
			};
		}
			
		// setup defaults if arguments aren't specified
		if (arguments.length < 1 || xpos === null) xpos = "50%";
		if (arguments.length < 2 || speedFactor === null) speedFactor = 0.1;
		if (arguments.length < 3 || outerHeight === null) outerHeight = true;
		
		// function to be called whenever the window is scrolled or resized
		function update(){
			var pos = $window.scrollTop();				

			$this.each(function(){
				var $element = $(this);
				var top = $element.offset().top;
				var height = getHeight($element);

				// Check if totally above or totally below viewport
				if (top + height < pos || top > pos + windowHeight) {
					return;
				}

				$this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px");
			});
		}		

		$window.bind('scroll', update).resize(update);
		update();
	};
	


/*   var ua = navigator.userAgent;
	 var vi  =  jQuery("#big-video-vid_html5_api");	
	 if(vi.length){
    if (ua.indexOf("iPhone") > 0) {
        setTimeout(function(){	
            vi[0].play();
        },1000);
    }
    else if (ua.indexOf("Android") > 0) {       
        vi[0].play();
        if ( vi[0].currentTime){
            vi[0].pause();
            setTimeout(function(){
                vi[0].play();
            },1000)
        }
    }
	
	 }*/
  
  
  // Detect province selected in Job´s page  
    function filterProvince(provinceVal) {
      $(".job-item, .offers-list .clear").hide();
      
      $(".job-item").each(function(){
      	if($(this).hasClass(provinceVal)){
      		$(this).fadeIn();        	
        }
      });
  	}
  
  $("#location-job-filter select").change(function() {    
    var provinceVal = $("#location-job-filter :selected").val();
    if(!provinceVal == "") {
    	filterProvince(provinceVal);
    }
  });
  
  
  
	
})(jQuery);


<file_sep>/includes/theme-setup.php
<?php


function onetone_setup(){

	global $content_width;
	$lang = get_template_directory(). '/languages';
	load_theme_textdomain('onetone', $lang);
	add_theme_support( 'post-thumbnails' ); 
	$args = array();
	$header_args = array( 
	    'default-image'          => '',
		 'default-repeat' => 'repeat',
        'default-text-color'     => 'CC9966',
        'width'                  => 1120,
        'height'                 => 80,
        'flex-height'            => true
     );
	// Enable support for Post Formats.
	add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio' ) );
	
	add_theme_support( 'custom-background', $args );
	add_theme_support( 'custom-header', $header_args );
	add_theme_support( 'automatic-feed-links' );
	add_theme_support('nav_menus');
	add_theme_support( "title-tag" );
	register_nav_menus( array(
							  'primary' => __( 'Primary Menu', 'onetone' ),
							  'home_menu' => __( 'Home Page Header Menu', 'onetone' ),
							  'top_bar_menu' => __( 'Top Bar Menu', 'onetone' ),
											  
											  ));
	
	/*
	 * Switch default core markup for search form, comment form, and comments
	 * to output valid HTML5.
	 */
	add_theme_support( 'html5', array(
		'search-form', 'comment-form', 'comment-list', 'gallery', 'caption',
	) );
	
	// Woocommerce Support
	add_theme_support( 'woocommerce' );



	add_editor_style("editor-style.css");
	if ( ! isset( $content_width ) ) $content_width = 1120;
	
	
	
}

add_action( 'after_setup_theme', 'onetone_setup' );


 function onetone_custom_scripts(){
	 global $page_meta,$post,$shop_style;
	 if($post){
	$page_meta = get_post_meta( $post->ID ,'_onetone_post_meta');
	}
	
	if( isset($page_meta[0]) && $page_meta[0]!='' )
	$page_meta = @json_decode( $page_meta[0],true );
	
    $theme_info = wp_get_theme();
	$detect = new Mobile_Detect;
	
	
	$body_font              = str_replace('&#039;','\'', esc_attr(onetone_option('body_font')));
   $standard_body_font     = str_replace('&#039;','\'',esc_attr(onetone_option('standard_body_font')));
   $menu_font              = str_replace('&#039;','\'',esc_attr(onetone_option('menu_font')));
   $standard_menu_font     = str_replace('&#039;','\'',esc_attr(onetone_option('standard_menu_font')));
   $headings_font          = str_replace('&#039;','\'',esc_attr(onetone_option('headings_font')));
   $standard_headings_font = str_replace('&#039;','\'',esc_attr(onetone_option('standard_headings_font')));
   $footer_headings_font          = str_replace('&#039;','\'',esc_attr(onetone_option('headings_font')));
   $standard_footer_headings_font = str_replace('&#039;','\'',esc_attr(onetone_option('standard_footer_headings_font')));
   $button_font            = str_replace('&#039;','\'',esc_attr(onetone_option('button_font')));
   $standard_button_font   = str_replace('&#039;','\'',esc_attr(onetone_option('standard_button_font')));
   
   $shop_style = absint(onetone_option('shop_style',1));

   if( $body_font ){
	  $body_font_url =   str_replace(', ','|',$body_font);
	wp_enqueue_style( 'google-fonts-'.sanitize_title($body_font), esc_url('//fonts.googleapis.com/css?family=' . str_replace(' ','+',$body_font_url), array(), '' ));
	
   }
   if( $menu_font ){
	   $menu_font_url =   str_replace(', ','|',$menu_font);
	wp_enqueue_style( 'google-fonts-'.sanitize_title($menu_font), esc_url('//fonts.googleapis.com/css?family=' . str_replace(' ','+',$menu_font_url), array(), '' ));
   }
   if( $headings_font ){
	   $headings_font_url =   str_replace(', ','|',$headings_font);
	wp_enqueue_style( 'google-fonts-'.sanitize_title($headings_font), esc_url('//fonts.googleapis.com/css?family=' . str_replace(' ','+',$headings_font_url), array(), '' ));
   }
    if( $footer_headings_font ){
		$footer_headings_font_url =   str_replace(', ','|',$footer_headings_font);
	wp_enqueue_style( 'google-fonts-'.sanitize_title($footer_headings_font), esc_url('//fonts.googleapis.com/css?family=' . str_replace(' ','+',$footer_headings_font_url), array(), '' ));
   }
   if( $button_font ){
	    $button_font_url =   str_replace(', ','|',$button_font);
	wp_enqueue_style( 'google-fonts-'.sanitize_title($button_font), esc_url('//fonts.googleapis.com/css?family=' . str_replace(' ','+',$button_font_url), array(), '' ));
   }
   
   
   $google_fonts = onetone_option('google_fonts','');
    if( trim($google_fonts) !='' ){
	$google_fonts = str_replace(' ','+',trim($google_fonts));
	wp_enqueue_style('google-fonts', esc_url('//fonts.googleapis.com/css?family='.$google_fonts), false, '', false );
	}
    wp_enqueue_style('font-awesome',  get_template_directory_uri() .'/plugins/font-awesome/css/font-awesome.min.css', false, '4.3.0', false);
	wp_enqueue_style('bootstrap',  get_template_directory_uri() .'/plugins/bootstrap/css/bootstrap.min.css', false, '3.3.4', false);
	wp_enqueue_style( 'owl.carousel',  get_template_directory_uri() .'/plugins/owl-carousel/assets/owl.carousel.css', false, '2.0.0', false );
	wp_enqueue_style('owl-theme',  get_template_directory_uri() .'/css/owl.theme.css', false, '1.3.3', false);
	wp_enqueue_style('bigvideo',  get_template_directory_uri() .'/css/bigvideo.css', false, '1.3.3', false);
	wp_enqueue_style('prettyPhoto',  get_template_directory_uri() .'/css/prettyPhoto.css', false, '3.1.5', false);
	
	wp_enqueue_style( 'onetone-main', get_stylesheet_uri(), array(), $theme_info->get( 'Version' ) );

	wp_enqueue_style('onetone-onetone-shortcodes',  get_template_directory_uri() .'/css/onetone-shortcodes.css', false, $theme_info->get( 'Version' ), false);
	wp_enqueue_style('onetone-onetone',  get_template_directory_uri() .'/css/onetone.css', false, $theme_info->get( 'Version' ), false);
	
	if ( class_exists( 'WooCommerce' ) ) {
	wp_enqueue_style('onetone-woocommerce',  get_template_directory_uri() .'/css/woo'.$shop_style.'.css', false, $theme_info->get( 'Version' ), false);
	}
	
	wp_enqueue_style('onetone-ms',  get_template_directory_uri() .'/css/onetone-ms.css', false, $theme_info->get( 'Version' ), false);
   
  // Jesús: Disable less theme file
	//wp_enqueue_style('onetone-scheme',  get_template_directory_uri() .'/css/scheme.less', array('magee-shortcode'), $theme_info->get( 'Version' ), false);
	wp_enqueue_style('onetone-home',  get_template_directory_uri() .'/css/home.css', false, $theme_info->get( 'Version' ), false);
	
	if ( is_rtl() ) {
       wp_enqueue_style('onetone-rtl',  get_template_directory_uri() .'/rtl.css', false, $theme_info->get( 'Version' ), false);
     }
	
   $background_array  = onetone_option("page_background");
   $background        = onetone_get_background($background_array);
   $header_image      = get_header_image();
   $onetone_custom_css = "";
	if (isset($header_image) && ! empty( $header_image )) {
	$onetone_custom_css .= ".home-header{background:url(".$header_image. ") repeat;}\n";
	}
    if ( 'blank' != get_header_textcolor() && '' != get_header_textcolor() ){
     $header_color        =  ' color:#' . get_header_textcolor() . ';';
	 $onetone_custom_css .=  'header .site-name,header .site-description,header .site-tagline{'.$header_color.'}';
		}
	else{
	$onetone_custom_css .=  'header .site-name,header .site-description,header .site-tagline{display:none;}';	
		
		}
	$custom_css           =  onetone_option("custom_css");
	$onetone_custom_css  .=  '.site{'.$background.'}';
	
	$links_color = onetone_option( 'links_color','#963');
	
	//scheme
	$primary_color = esc_attr(onetone_option('primary_color',$links_color));

	
	
	$links_color = onetone_option( 'links_color');
	
	//if($links_color == "" || $links_color == null)
	//$links_color = "#963";
	if($links_color )
	$onetone_custom_css  .=  '.entry-content a,.home-section-content a{color:'.$links_color.' ;}';


	$top_menu_font_color = onetone_option( 'font_color');
	if($top_menu_font_color !="" && $top_menu_font_color!=null){
		$onetone_custom_css  .=  'header .site-nav > ul > li > a {color:'.$top_menu_font_color.'}';
		}
		
	// header
	$sticky_header_background_color    = esc_attr(onetone_option('sticky_header_background_color',''));
    $sticky_header_background_opacity  = esc_attr(onetone_option('sticky_header_background_opacity','1')); 
	$header_background_color           = esc_attr(onetone_option('header_background_color',''));
    $header_background_opacity         = esc_attr(onetone_option('header_background_opacity','1')); 
	$header_border_color               = esc_attr(onetone_option('header_border_color','')); 
	$page_title_bar_background_color   = esc_attr(onetone_option('page_title_bar_background_color','')); 
	$page_title_bar_borders_color      = esc_attr(onetone_option('page_title_bar_borders_color','')); 
	
	// sticky header background
	if($sticky_header_background_color){
		$rgb = onetone_hex2rgb( $sticky_header_background_color );
	    $onetone_custom_css .= ".fxd-header {
		background-color: rgba(".$rgb[0].",".$rgb[1].",".$rgb[2].",".$sticky_header_background_opacity.");
		}";
		
		}
		
		// main header background
	if( $header_background_color ){
		$rgb = onetone_hex2rgb( $header_background_color );
	    $onetone_custom_css .= ".main-header {
		background-color: rgba(".$rgb[0].",".$rgb[1].",".$rgb[2].",".$header_background_opacity.");
		}";
		
		}
	
	// sticky header
  
	$sticky_header_opacity               =  onetone_option('sticky_header_background_opacity','1');
	$sticky_header_menu_item_padding     =  onetone_option('sticky_header_menu_item_padding','');
	$sticky_header_navigation_font_size  =  onetone_option('sticky_header_navigation_font_size','');
	$sticky_header_logo_width            =  onetone_option('sticky_header_logo_width','');
	$logo_left_margin                    =  onetone_option('logo_left_margin','');
	$logo_right_margin                   =  onetone_option('logo_right_margin','');
	$logo_top_margin                     =  onetone_option('logo_top_margin','');
	$logo_bottom_margin                  =  onetone_option('logo_bottom_margin','');
		
	if( $sticky_header_background_color ){
		$rgb = onetone_hex2rgb( $sticky_header_background_color );
	    $onetone_custom_css .= ".fxd-header{background-color: rgba(".$rgb[0].",".$rgb[1].",".$rgb[2].",".esc_attr($sticky_header_opacity).");}\r\n";
		
	}
	
	
    if( $sticky_header_menu_item_padding )
	$onetone_custom_css .= ".fxd-header .site-nav > ul > li > a {padding:".absint($sticky_header_menu_item_padding)."px;}\r\n";
	if( $sticky_header_navigation_font_size )
	$onetone_custom_css .= ".fxd-header .site-nav > ul > li > a {font-size:".absint($sticky_header_navigation_font_size)."px;}\r\n";
	if( $sticky_header_logo_width )
	$onetone_custom_css .= ".fxd-header img.site-logo{ width:".absint($sticky_header_logo_width)."px;}\r\n";
	
	if( $logo_left_margin )
	$onetone_custom_css .= ".fxd-header img.site-logo{ margin-left:".absint($logo_left_margin)."px;}\r\n";
	if( $logo_right_margin )
	$onetone_custom_css .= ".fxd-header img.site-logo{ margin-right:".absint($logo_right_margin)."px;}\r\n";
	if( $logo_top_margin )
	$onetone_custom_css .= ".fxd-header img.site-logo{ margin-top:".absint($logo_top_margin)."px;}\r\n";
	if( $logo_bottom_margin )
	$onetone_custom_css .= ".fxd-header img.site-logo{ margin-bottom:".absint($logo_bottom_margin)."px;}\r\n";
	
	
	// top bar
	$display_top_bar             = onetone_option('display_top_bar','yes');
	$top_bar_background_color    = onetone_option('top_bar_background_color','');
	$top_bar_info_color          = onetone_option('top_bar_info_color','');
	$top_bar_menu_color          = onetone_option('top_bar_menu_color','');
	
	if( $top_bar_background_color )
	$onetone_custom_css .= ".top-bar{background-color:".$top_bar_background_color.";}";
	
	if( $display_top_bar == 'yes' )
	$onetone_custom_css .= ".top-bar{display:block;}";
	
	if( $top_bar_info_color  )
	$onetone_custom_css .= ".top-bar-info{color:".$top_bar_info_color.";}";
	
	if( $top_bar_menu_color  )
	$onetone_custom_css .= ".top-bar ul li a{color:".$top_bar_menu_color.";}";
	
	// Header background
    $header_background_image     = onetone_option('header_background_image','');
	$header_background_full      = onetone_option('header_background_full','');
	$header_background_repeat    = onetone_option('header_background_repeat','');
	$header_background_parallax  = onetone_option('header_background_parallax','');
	
	$header_background       = '';
	if( $header_background_image ){
		$header_background  .= "header .main-header{\r\n";
		
	    $header_background  .= "background-image: url(".esc_url($header_background_image).");\r\n";
		if( $header_background_full == 'yes' )
		$header_background  .= "-webkit-background-size: cover;
								-moz-background-size: cover;
								-o-background-size: cover;
								background-size: cover;\r\n";
	   if( $header_background_parallax  == 'no' )		
	   $header_background  .=  "background-repeat:".$header_background_repeat.";";
	   if( $header_background_parallax  == 'yes' )
	   $header_background  .= "background-attachment: fixed;
		                       background-position:top center;
							   background-repeat: no-repeat;";
	   
								
        $header_background  .= "}\r\n";	
	}
	
	
	$onetone_custom_css .= $header_background;
	
	// Header  Padding
	$header_top_padding     = onetone_option('header_top_padding','');
	$header_bottom_padding  = onetone_option('header_bottom_padding','');
	
	if( $header_top_padding )
	$onetone_custom_css .= ".site-nav > ul > li > a{padding-top:".$header_top_padding."}";
	
	if( $header_bottom_padding )
	$onetone_custom_css .= ".site-nav > ul > li > a{padding-bottom:".$header_bottom_padding."}";
	
	
	
	
// page title bar

	$page_title_bar_top_padding           = esc_attr(onetone_option('page_title_bar_top_padding','210px'));
	$page_title_bar_bottom_padding        = esc_attr(onetone_option('page_title_bar_bottom_padding','160px'));
	$page_title_bar_mobile_top_padding    = esc_attr(onetone_option('page_title_bar_mobile_top_padding','70px'));
	$page_title_bar_mobile_bottom_padding = esc_attr(onetone_option('page_title_bar_mobile_bottom_padding','50px'));
	
	$page_title_bar_background_img        = esc_url(onetone_option('page_title_bar_background',''));
	$page_title_bar_retina_background     = esc_url(onetone_option('page_title_bar_retina_background',''));
	$page_title_bg_full                   = esc_attr(onetone_option('page_title_bg_full','no'));
	$page_title_bg_parallax               = esc_attr(onetone_option('page_title_bg_parallax','no'));
	
	
	$page_title_bar_background  = '';
	if( $page_title_bar_background_img ){
		$page_title_bar_background  .= ".page-title-bar{\r\n";
		
	    $page_title_bar_background  .= "background-image: url(".esc_url($page_title_bar_background_img).");\r\n";
		if( $page_title_bg_full == 'yes' )
		$page_title_bar_background  .= "-webkit-background-size: cover;
								-moz-background-size: cover;
								-o-background-size: cover;
								background-size: cover;\r\n";
	   if( $header_background_parallax  == 'no' )		
	   $page_title_bar_background  .=  "background-repeat:".$header_background_repeat.";";
	   if( $page_title_bg_parallax  == 'yes' )
	   $page_title_bar_background  .= "background-attachment: fixed;
		                       background-position:top center;
							   background-repeat: no-repeat;";
								
        $page_title_bar_background  .= "}\r\n";	
	}
	
	$onetone_custom_css .=  $page_title_bar_background ;
	
	
	$page_title_bar_background  = '';
	if( $page_title_bar_retina_background ){
		$page_title_bar_background  .= ".page-title-bar-retina{\r\n";
		
	    $page_title_bar_background  .= "background-image: url(".esc_url($page_title_bar_retina_background).") !important;\r\n";
		if( $page_title_bg_full == 'yes' )
		$page_title_bar_background  .= "-webkit-background-size: cover;
								-moz-background-size: cover;
								-o-background-size: cover;
								background-size: cover;\r\n";
	   if( $header_background_parallax  == 'no' )		
	   $page_title_bar_background  .=  "background-repeat:".$header_background_repeat.";";
	   if( $page_title_bg_parallax  == 'yes' )
	   $page_title_bar_background  .= "background-attachment: fixed;
		                       background-position:top center;
							   background-repeat: no-repeat;";
		  
        $page_title_bar_background  .= "}\r\n";	
	}
	
	
	$onetone_custom_css .=  $page_title_bar_background ;
	
	
	if( $detect->isMobile() ){
		
	$onetone_custom_css .= ".page-title-bar{
		padding-top:".$page_title_bar_mobile_top_padding .";
		padding-bottom:".$page_title_bar_mobile_bottom_padding .";
		}";
		
	}else{
	
	$onetone_custom_css .= ".page-title-bar{
		padding-top:".$page_title_bar_top_padding .";
		padding-bottom:".$page_title_bar_bottom_padding .";
		}";
	}
	
	
	
	//background 
	$content_background_color          = esc_attr(onetone_option('content_background_color',''));
	$sidebar_background_color          = esc_attr(onetone_option('sidebar_background_color',''));
	$footer_background_color           = esc_attr(onetone_option('footer_background_color',''));
	$copyright_background_color        = esc_attr(onetone_option('copyright_background_color',''));
		
	// content backgroud color
		
    if( $content_background_color )
	 $onetone_custom_css  .= ".col-main {background-color:".$content_background_color.";}";
	 
	if( $sidebar_background_color )
	$onetone_custom_css  .= ".col-aside-left,.col-aside-right {background-color:".$sidebar_background_color.";}";
	
	//footer background
	if( $footer_background_color )
	 $onetone_custom_css  .= "footer .footer-widget-area{background-color:".$footer_background_color.";}";
	 
	 if( $copyright_background_color )
	 $onetone_custom_css  .= "footer .footer-info-area{background-color:".$copyright_background_color."}";
	 
		
	// Element Colors
	
	$form_background_color             = esc_attr(onetone_option('form_background_color',''));
	$form_text_color                   = esc_attr(onetone_option('form_text_color',''));
	$form_border_color                 = esc_attr(onetone_option('form_border_color',''));
	
	
	if( $form_background_color )
	$onetone_custom_css  .= "footer input,footer textarea{background-color:".$form_background_color.";}";
	
	if( $form_text_color )
	$onetone_custom_css  .= "footer input,footer textarea{color:".$form_text_color.";}";
	
	if( $form_border_color )
	$onetone_custom_css  .= "footer input,footer textarea{border-color:".$form_border_color.";}";
	
	
	
	// body font
	if( $body_font ){
	$onetone_custom_css  .= "body{
		font-family:".$body_font.";
		}\r\n";
	}else{
		if( $standard_body_font ){
			$onetone_custom_css  .= "body{
			font-family:".$standard_body_font.";
			}\r\n";
			
			}
		}
	
	  // menu font
	if( $menu_font ){

	$onetone_custom_css  .= "#menu-main li a span{
		font-family:".$menu_font.";
		}\r\n";
	}else{
		if( $standard_menu_font ){
			$onetone_custom_css  .= "#menu-main li a span{
			font-family:".$standard_menu_font.";
			}\r\n";
			
			}
		}
	
	// headings font
	
	if( $headings_font ){

	$onetone_custom_css  .= "h1,h2,h3,h4,h5,h6{
		font-family:".$headings_font.";
		}\r\n";
	}else{
		if( $standard_headings_font ){
			$onetone_custom_css  .= "h1,h2,h3,h4,h5,h6{
			font-family:".$standard_headings_font.";
			}\r\n";
			
			}
		}
		
	// footer headings font
	
	if( $headings_font ){

	$onetone_custom_css  .= "footer h1,footer h2,footer h3,footer h4,footer h5,footer h6{
		font-family:".$headings_font.";
		}\r\n";
	}else{
		if( $standard_headings_font ){
			$onetone_custom_css  .= "footer h1,footer h2,footer h3,footer h4,footer h5,footer h6{
			font-family:".$standard_headings_font.";
			}\r\n";
			
			}
		}
		
	// button font
	
	if( $button_font ){

	$onetone_custom_css  .= "a.btn-normal{
		font-family:".$button_font.";
		}\r\n";
	}else{
		if( $standard_button_font ){
			$onetone_custom_css  .= "a.btn-normal{
			font-family:".$standard_button_font.";
			}\r\n";
			
			}
		}
		
		
	//Layout Options
	
	$page_content_top_padding          = esc_attr(onetone_option('page_content_top_padding',''));
	$page_content_bottom_padding       = esc_attr(onetone_option('page_content_bottom_padding',''));
	$hundredp_padding                  = esc_attr(onetone_option('hundredp_padding',''));
	$sidebar_padding                   = esc_attr(onetone_option('sidebar_padding',''));
	$column_top_margin                 = esc_attr(onetone_option('column_top_margin',''));
	$column_bottom_margin              = esc_attr(onetone_option('column_bottom_margin',''));
	
	if( $page_content_top_padding )
	$onetone_custom_css  .= ".post-inner,.page-inner{padding-top:".$page_content_top_padding.";}";
	if( $page_content_bottom_padding )
	$onetone_custom_css  .= ".post-inner,.page-inner{padding-bottom:".$page_content_bottom_padding.";}";
	
	if( isset($page_meta['padding_top']) && $page_meta['padding_top'] !='' )
	$onetone_custom_css  .= ".post-inner,.page-inner{padding-top:".esc_attr($page_meta['padding_top']).";}";
	if( isset($page_meta['padding_bottom']) && $page_meta['padding_bottom'] !='' )
	$onetone_custom_css  .= ".post-inner,.page-inner{padding-bottom:".esc_attr($page_meta['padding_bottom']).";}";
	
	
	
	if( $sidebar_padding )
	$onetone_custom_css  .= ".col-aside-left,.col-aside-right{padding:".$sidebar_padding.";}";
	if( $column_top_margin )
	$onetone_custom_css  .= ".col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9{margin-top:".$column_top_margin.";}";
	
	if( $column_bottom_margin )
	$onetone_custom_css  .= ".col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9{margin-bottom:".$column_bottom_margin.";}";
	
	
	//fonts color
	
	$header_tagline_color              = esc_attr(onetone_option('header_tagline_color',''));
	$page_title_color                  = esc_attr(onetone_option('page_title_color',''));
	$h1_color                          = esc_attr(onetone_option('h1_color',''));
	$h2_color                          = esc_attr(onetone_option('h2_color',''));
	$h3_color                          = esc_attr(onetone_option('h3_color',''));
	$h4_color                          = esc_attr(onetone_option('h4_color',''));
	$h5_color                          = esc_attr(onetone_option('h5_color',''));
	$h6_color                          = esc_attr(onetone_option('h6_color',''));
	$body_text_color                   = esc_attr(onetone_option('body_text_color',''));
	$link_color                        = esc_attr(onetone_option('link_color',''));
	$breadcrumbs_text_color            = esc_attr(onetone_option('breadcrumbs_text_color',''));
	$sidebar_widget_headings_color     = esc_attr(onetone_option('sidebar_widget_headings_color',''));
	$footer_headings_color             = esc_attr(onetone_option('footer_headings_color',''));
	$footer_text_color                 = esc_attr(onetone_option('footer_text_color',''));
	$footer_link_color                 = esc_attr(onetone_option('footer_link_color',''));
	
	if( $header_tagline_color )
	$onetone_custom_css  .= ".site-tagline{color:".$header_tagline_color.";}";
	if( $page_title_color )
	$onetone_custom_css  .= ".page-title h1{color:".$page_title_color.";}";
	if( $h1_color )
	$onetone_custom_css  .= "h1{color:".$h1_color.";}";
	if( $h2_color )
	$onetone_custom_css  .= "h2{color:".$h2_color.";}";
	if( $h3_color )
	$onetone_custom_css  .= "h3{color:".$h3_color.";}";
	if( $h4_color )
	$onetone_custom_css  .= "h4{color:".$h4_color.";}";
	if( $h5_color )
	$onetone_custom_css  .= "h5{color:".$h5_color.";}";
	if( $h6_color )
	$onetone_custom_css  .= "h6{color:".$h6_color.";}";
	if( $body_text_color )
	$onetone_custom_css  .= ".entry-content,.entry-content p{color:".$body_text_color.";}";
	if( $link_color )
	$onetone_custom_css  .= ".entry-summary a, .entry-content a{color:".$link_color.";}";
	if( $breadcrumbs_text_color )
	$onetone_custom_css  .= ".breadcrumb-nav span,.breadcrumb-nav a{color:".$breadcrumbs_text_color.";}";
	if( $sidebar_widget_headings_color )
	$onetone_custom_css  .= ".col-aside-left .widget-title,.col-aside-right .widget-title{color:".$sidebar_widget_headings_color.";}";
	if( $footer_headings_color )
	$onetone_custom_css  .= ".footer-widget-area .widget-title{color:".$footer_headings_color.";}";
	if( $footer_text_color )
	$onetone_custom_css  .= ".footer-widget-area,.footer-widget-area p,.footer-widget-area span{color:".$footer_text_color.";}";
	if( $footer_link_color )
	$onetone_custom_css  .= ".footer-widget-area a{color:".$footer_link_color.";}";
	
	//Main Menu Colors 
	$main_menu_background_color_1   = esc_attr(onetone_option('main_menu_background_color_1',''));
	$main_menu_font_color_1         = esc_attr(onetone_option('main_menu_font_color_1',''));
	$main_menu_font_hover_color_1   = esc_attr(onetone_option('main_menu_font_hover_color_1',''));
	$main_menu_background_color_2   = esc_attr(onetone_option('main_menu_background_color_2',''));
	$main_menu_font_color_2         = esc_attr(onetone_option('main_menu_font_color_2',''));
	$main_menu_font_hover_color_2   = esc_attr(onetone_option('main_menu_font_hover_color_2',''));
	$main_menu_separator_color_2    = esc_attr(onetone_option('main_menu_separator_color_2',''));
	$woo_cart_menu_background_color = esc_attr(onetone_option('woo_cart_menu_background_color',''));
	if( $main_menu_background_color_1 )
	$onetone_custom_css  .= ".main-header{background-color:".$main_menu_background_color_1.";}";
	if( $main_menu_font_color_1 )
	$onetone_custom_css  .= "#menu-main > li > a {color:".$main_menu_font_color_1.";}";
	if( $main_menu_font_hover_color_1 )
	$onetone_custom_css  .= "#menu-main > li > a:hover,#menu-main > li.current > a{color:".$main_menu_font_hover_color_1.";}";
	if( $main_menu_background_color_2 )
	$onetone_custom_css  .= ".main-header .sub-menu{background-color:".$main_menu_background_color_2.";}";
	if( $main_menu_font_color_2 )
	$onetone_custom_css  .= "#menu-main  li li a{color:".$main_menu_font_color_2.";}";
	if( $main_menu_font_hover_color_2 )
	$onetone_custom_css  .= "#menu-main  li li a:hover{color:".$main_menu_font_hover_color_2.";}";
	if( $main_menu_separator_color_2 )
	$onetone_custom_css  .= ".site-nav  ul li li a{border-color:".$main_menu_separator_color_2." !important;}";
	
	
	// footer
	
	$footer_background_image          = onetone_option('footer_background_image',''); 
	$footer_bg_full                   = onetone_option('footer_bg_full','yes'); 
	$footer_background_repeat         = onetone_option('footer_background_repeat',''); 
	$footer_background_position       = onetone_option('footer_background_position',''); 
	$footer_top_padding               = onetone_option('footer_top_padding',''); 
	$footer_bottom_padding            = onetone_option('footer_bottom_padding',''); 
	
	$copyright_top_padding            = onetone_option('copyright_top_padding',''); 
	$copyright_bottom_padding         = onetone_option('copyright_bottom_padding',''); 
 
   
    $footer_background = "";
	
	if( $footer_background_image ){
		$footer_background  .= ".footer-widget-area{\r\n";
		
	    $footer_background  .= "background-image: url(".esc_url($footer_background_image).");\r\n";
		if( $footer_bg_full == 'yes' )
		$footer_background  .= "-webkit-background-size: cover;
								-moz-background-size: cover;
								-o-background-size: cover;
								background-size: cover;\r\n";
		
	   $footer_background  .=  "background-repeat:".esc_attr($footer_background_repeat).";";
	   $footer_background  .=  "background-position:".esc_attr($footer_background_position).";";

		  
        $footer_background  .= "}\r\n";	
	}
	
	$onetone_custom_css      .= $footer_background ;
	
	$onetone_custom_css      .= ".footer-widget-area{\r\n
	                           padding-top:".$footer_top_padding.";\r\n
							   padding-bottom:".$footer_bottom_padding.";\r\n
							   }" ;
	$onetone_custom_css      .= ".footer-info-area{\r\n
	                           padding-top:".$copyright_top_padding.";\r\n
							   padding-bottom:".$copyright_bottom_padding.";\r\n
							   }" ;
	
	// home page sections 
	
	$section_title_css   = '';
	$section_content_css = '';
	
	
	$video_background_section  = onetone_option( 'video_background_section' );
	for($i=0;$i<15;$i++):
	
	$section_css         = '';
	
	$section_background  = onetone_option( 'section_background_'.$i );
	$background_size     = onetone_option( 'background_size_'.$i );
	$section_padding     = onetone_option( 'section_padding_'.$i ,$i == 0?'':'50px 0');
    $text_align          = onetone_option( 'text_align_'.$i);
	$parallax_scrolling  = onetone_option( 'parallax_scrolling_'.$i );
	
	$section_title_typography    = onetone_option( 'section_title_typography_'.$i);
    $title_typography            = onetone_get_typography( $section_title_typography );
 
	$section_content_typography  = onetone_option( 'section_content_typography_'.$i);
	$content_typography          = onetone_get_typography( $section_content_typography );
	
	
	if( $parallax_scrolling == "yes" || $parallax_scrolling == "1" ){
	    $section_css .= "background-attachment:fixed;background-position:50% 0;background-repeat:repeat;\r\n";
	 }
	 
	if( $background_size == "yes" ){
		$section_css .= "-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;\r\n";
	}
	if( $section_padding ){
	    $section_css .= "padding:".$section_padding.";\r\n";; 
	}
	
    if( $video_background_section != ($i+1) || $detect->isMobile() || $detect->isTablet() )
	$section_css       .= onetone_get_background( $section_background );
	
	
	$section_title_css .= "section.home-section-".($i+1)." .section-title{text-align:center ;}\r\n";
	
	if( $title_typography )
	$section_title_css .= "section.home-section-".($i+1)." .section-title{".$title_typography."}\r\n";
	
	if( $content_typography )
	$section_content_css .= "section.home-section-".($i+1)." .home-section-content,section.home-section-".($i+1)." .home-section-content p{".$content_typography."}\r\n";
	if( $text_align )
    $section_content_css .= "section.home-section-".($i+1)." .home-section-content{text-align:".$text_align."}\r\n";
	$section_content_css .=  "section.home-section-".($i+1)." {".$section_css."}\r\n";	
	
	endfor;
	
	$onetone_custom_css  .=  $section_title_css;
	$onetone_custom_css  .=  $section_content_css;
	
	$onetone_custom_css  .=  $custom_css;
	
	wp_add_inline_style( 'onetone-main', $onetone_custom_css );
	
	wp_enqueue_style( 'onetone-bigvideo', get_template_directory_uri().'/plugins/YTPlayer/css/jquery.mb.YTPlayer.min.css','', '', true );
	wp_enqueue_script( 'onetone-bigvideo', get_template_directory_uri().'/plugins/YTPlayer/jquery.mb.YTPlayer.js', array( 'jquery' ), '', true );

	wp_enqueue_script( 'modernizr', get_template_directory_uri().'/plugins/modernizr.custom.js', array( 'jquery' ), '2.8.2', false );
	wp_enqueue_script( 'bootstrap', get_template_directory_uri().'/plugins/bootstrap/js/bootstrap.min.js', array( 'jquery' ), '3.3.4', false );
    wp_enqueue_script( 'nav', get_template_directory_uri().'/plugins/jquery.nav.js', array( 'jquery' ), '1.4.14 ', false );
	wp_enqueue_script( 'scrollTo', get_template_directory_uri().'/plugins/jquery.scrollTo.js', array( 'jquery' ), '1.4.14', false );
	wp_enqueue_script( 'parallax', get_template_directory_uri().'/plugins/jquery.parallax-1.1.3.js', array( 'jquery' ), '1.1.3', true );
	wp_enqueue_script( 'respond', get_template_directory_uri().'/plugins/respond.min.js', array( 'jquery' ), '', true );
	wp_enqueue_script( 'less', get_template_directory_uri().'/plugins/less.min.js', array( 'jquery' ), '2.5.1', true );
	wp_enqueue_script( 'prettyPhoto', get_template_directory_uri().'/plugins/jquery.prettyPhoto.js', array( 'jquery' ), '3.1.5', true );
	wp_enqueue_script( 'masonry', get_template_directory_uri() . '/plugins/jquery-masonry/jquery.masonry.min.js', array( 'jquery' ), null, true );
	wp_enqueue_script( 'waypoints', get_template_directory_uri() . '/plugins/jquery.waypoints.js', array( 'jquery' ), null, true );
	wp_enqueue_script( 'easing', get_template_directory_uri() . '/plugins/jquery.easing.min.js' , array( 'jquery' ), null, true);
	wp_enqueue_script( 'owl.carousel', get_template_directory_uri() . '/plugins/owl-carousel/owl.carousel.min.js', array( 'jquery' ), null, true );
	wp_enqueue_script( 'smoothscroll', get_template_directory_uri() . '/plugins/smoothscroll.js', array( 'jquery' ), '0.9.9', true );
	wp_enqueue_script( 'mixitup', get_template_directory_uri() . '/plugins/jquery.mixitup.min.js', array( 'jquery' ), '', true );
	
	wp_enqueue_script( 'onetone-default', get_template_directory_uri().'/js/onetone.js', array( 'jquery' ),$theme_info->get( 'Version' ), true );
	
	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ){wp_enqueue_script( 'comment-reply' );}
	
	$slide_time = onetone_option("slide_time");
	$slide_time = is_numeric($slide_time)?$slide_time:"5000";
	
	$isMobile = 0;
	if( $detect->isMobile() && !$detect->isTablet() ){
		$isMobile = 1;
		}
	
	$sticky_header    = esc_attr(onetone_option('enable_sticky_header','yes'));
	
	
	
	
	wp_localize_script( 'onetone-default', 'onetone_params', array(
			'ajaxurl'        => admin_url('admin-ajax.php'),
			'themeurl' => get_template_directory_uri(),
			'slideSpeed'  => $slide_time,
			'sticky_header' => $sticky_header,
			'isMobile' =>$isMobile,
			'primary_color' => $primary_color,
		)  );
	
	
	
	}
	
	function onetone_admin_scripts(){
		global $pagenow ;
		$theme_info = wp_get_theme();
		
		wp_enqueue_script('media-upload');
        wp_enqueue_script('thickbox');
        wp_enqueue_style('thickbox');

		wp_enqueue_style( 'onetone-admin', get_template_directory_uri().'/css/admin.css', false, $theme_info->get( 'Version' ), false);
		wp_enqueue_style('magnific-popup',  get_template_directory_uri() .'/css/magnific-popup.css', false, '0.9.9', false);
		if( $pagenow == "post.php" || $pagenow == "post-new.php" || (isset($_GET['page']) && $_GET['page'] == "onetone-options") ):
		wp_enqueue_style('font-awesome',  get_template_directory_uri() .'/plugins/font-awesome/css/font-awesome.min.css', false, '4.4.0', false);
		wp_enqueue_style('onetone-options',  get_template_directory_uri() .'/css/options.css', false, $theme_info->get( 'Version' ), false);

		endif;
		wp_enqueue_script( 'magnific-popup', get_template_directory_uri().'/plugins/jquery.magnific-popup.min.js', array( 'jquery' ), '0.9.9', true );
		wp_enqueue_script( 'onetone-admin', get_template_directory_uri().'/js/admin.js', array( 'jquery' ), $theme_info->get( 'Version' ), false );
		
	    wp_localize_script( 'onetone-admin', 'onetone_params', array(
			'ajaxurl'        => admin_url('admin-ajax.php'),
			'themeurl' => get_template_directory_uri(),
		)  );
		
		}
		
	

  add_action( 'wp_enqueue_scripts', 'onetone_custom_scripts' );
  add_action( 'admin_enqueue_scripts', 'onetone_admin_scripts' );



function onetone_of_get_options($default = false) {
	
	global $options_saved;
	$options_saved = false;
	
	//$optionsframework_settings = get_option(ONETONE_OPTIONS_PREFIXED.'optionsframework');
	
	// Gets the unique option id
	//$option_name = $optionsframework_settings['id'];
	
	$option_name  = optionsframework_option_name();
	
	if ( get_option($option_name) ) {
		$options = get_option($option_name);
		$options_saved = true;
	}
	else{
		
		 $location = apply_filters( 'options_framework_location', array('includes/admin-options.php') );

	        if ( $optionsfile = locate_template( $location ) ) {
				
	            $maybe_options = require_once $optionsfile;
	            if ( is_array( $maybe_options ) ) {
					$options = $maybe_options;
	            } else if ( function_exists( 'optionsframework_options' ) ) {
					$options = optionsframework_options();
				}
	        }
	    $options = apply_filters( 'of_options', $options );
		$config  =  $options;
		foreach ( (array) $config as $option ) {
			if ( ! isset( $option['id'] ) ) {
				continue;
			}
			if ( ! isset( $option['std'] ) ) {
				continue;
			}
			if ( ! isset( $option['type'] ) ) {
				continue;
			}
				$output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option );
		}
		$options = $output;
		
		
		}
		
	if ( isset($options) ) {
		return $options;
	} else {
		return $default;
	}
}


global $onetone_options, $options_saved;
$onetone_options = onetone_of_get_options();

function onetone_option($name,$default=''){
	
	global $onetone_options;
	if(isset($onetone_options[$name]))
	return $onetone_options[$name];
	else
	return $default;
}


function onetone_on_switch_theme(){
global $onetone_options;
 
 $option_name  = optionsframework_option_name();
 // Import lite version options to pro version
 if(!get_option( $option_name ) && get_option('onetone')){
	 
	 add_option( $option_name ,get_option('onetone'));
	 
 }
 
/*  if(!get_option($option_name)){
 $config = array();
 $output = array();
 $location = apply_filters( 'options_framework_location', array('admin-options.php') );

	        if ( $optionsfile = locate_template( $location ) ) {
	            $maybe_options = require_once $optionsfile;
	            if ( is_array( $maybe_options ) ) {
					$options = $maybe_options;
	            } else if ( function_exists( 'optionsframework_options' ) ) {
					$options = optionsframework_options();
				}
	        }
	    $options = apply_filters( 'of_options', $options );
		$config  =  $options;
		foreach ( (array) $config as $option ) {
			if ( ! isset( $option['id'] ) ) {
				continue;
			}
			if ( ! isset( $option['std'] ) ) {
				continue;
			}
			if ( ! isset( $option['type'] ) ) {
				continue;
			}
				$output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option );
		}
		add_option($option_name,$output);
		
}
*/
 //
 
$onetone_options = onetone_of_get_options();
}
add_action( 'after_setup_theme', 'onetone_on_switch_theme' );
add_action('after_switch_theme', 'onetone_on_switch_theme');


/* 
 * This is an example of how to add custom scripts to the options panel.
 * This one shows/hides the an option when a checkbox is clicked.
 */

add_action('optionsframework_custom_scripts', 'onetone_optionsframework_custom_scripts');

function onetone_optionsframework_custom_scripts() { 

}

add_filter('options_framework_location','onetone_options_framework_location_override');

function onetone_options_framework_location_override() {
	return array('includes/admin-options.php');
}

function onetone_optionscheck_options_menu_params( $menu ) {
	
	$menu['page_title'] = __( 'Onetone Options', 'onetone');
	$menu['menu_title'] = __( 'Onetone Options', 'onetone');
	$menu['menu_slug'] = 'onetone-options';
	return $menu;
}

add_filter( 'optionsframework_menu', 'onetone_optionscheck_options_menu_params' );
/*
function onetone_wp_title( $title, $sep ) {
	global $paged, $page;
	if ( is_feed() )
		return $title;

	// Add the site name.
	$title .= get_bloginfo( 'name' );

	// Add the site description for the home/front page.
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) )
		$title = "$title $sep $site_description";

	// Add a page number if necessary.
	if ( $paged >= 2 || $page >= 2 )
		$title = "$title $sep " . sprintf( __( ' Page %s ', 'onetone' ), max( $paged, $page ) );

	return $title;
}
add_filter( 'wp_title', 'onetone_wp_title', 10, 2 );
*/

function onetone_title( $title ) {
if ( $title == '' ) {
  return __( 'Untitled', 'onetone');
  } else {
  return $title;
  }
}
add_filter( 'the_title', 'onetone_title' );<file_sep>/includes/theme-widget.php
<?php
// global $wp_registered_sidebars;
#########################################
function onetone_widgets_init() {
	
	global $sidebars ;
	  $sidebars =   array(
            ''  => __( 'No Sidebar', 'onetone' ),
		    'default_sidebar'  => __( 'Default Sidebar', 'onetone' ),
			'displayed_everywhere'  => __( 'Displayed Everywhere', 'onetone' ),
			'post'  => __( 'Post Sidebar', 'onetone' ),
			'post_category'  => __( 'Post Category Sidebar', 'onetone' ),
			'portfolio'  => __( 'Portfolio Sidebar', 'onetone' ),
			'portfolio_category'  => __( 'Portfolio Category Sidebar', 'onetone' ),
			'shop'  => __( 'Shop Sidebar', 'onetone' ),
			
			'sidebar-1'  => __( 'Sidebar 1', 'onetone' ),
			'sidebar-2'  => __( 'Sidebar 2', 'onetone' ),
			'sidebar-3'  => __( 'Sidebar 3', 'onetone' ),
			'sidebar-4'  => __( 'Sidebar 4', 'onetone' ),
			'sidebar-5'  => __( 'Sidebar 5', 'onetone' ),
			'sidebar-5'  => __( 'Sidebar 5', 'onetone' ),
			'sidebar-6'  => __( 'Sidebar 6', 'onetone' ),
			'sidebar-7'  => __( 'Sidebar 7', 'onetone' ),
			'sidebar-8'  => __( 'Sidebar 8', 'onetone' ),
			'footer_widget_1'  => __( 'Footer Area One', 'onetone' ),
			'footer_widget_2'  => __( 'Footer Area Two', 'onetone' ),
			'footer_widget_3'  => __( 'Footer Area Three', 'onetone' ),
			'footer_widget_4'  => __( 'Footer Area Four', 'onetone' ),
          );
	  
	  foreach( $sidebars as $k => $v ){
		  if( $k !='' ){
		  register_sidebar(array(
			'name' => $v,
			'id'   => $k,
			'before_widget' => '<div id="%1$s" class="widget widget-box %2$s">', 
			'after_widget' => '<span class="seperator extralight-border"></span></div>', 
			'before_title' => '<h2 class="widget-title">', 
			'after_title' => '</h2>' 
			));
		  }
		  }
	    
		
}
add_action( 'widgets_init', 'onetone_widgets_init' );<file_sep>/home-sections/section-youtube-video.php
<?php
 $video_background_section  = onetone_option( 'video_background_section' );
 $i                         = $video_background_section-1 ;
 $video_controls            = onetone_option( 'video_controls' );
 $section_background_video  = onetone_option( 'section_background_video_0' );
 $youtube_bg_type         = onetone_option("youtube_bg_type");
 $youtube_bg_type         = is_numeric($youtube_bg_type)?$youtube_bg_type:"1";
 $display_video_mobile      = onetone_option("display_video_mobile","no");
 $start_play                = onetone_option("section_youtube_start",3);

 $youtube_autoplay            = onetone_option("youtube_autoplay");
 $youtube_loop                = onetone_option("youtube_loop");
 $youtube_mute                = onetone_option("youtube_mute");
 
 if( $youtube_autoplay == '1' )
 $youtube_autoplay = 'true';
 else
 $youtube_autoplay = 'false';
 
 if( $youtube_loop == '1' )
 $youtube_loop = 'true';
 else
 $youtube_loop = 'false';
 
 if( $youtube_mute == '1' )
 $youtube_mute = 'true';
 else
 $youtube_mute = 'false';
  
  $containment = '.onetone-youtube-section';
  if( $youtube_bg_type == '1')
  $containment = 'body';
	
?>
<section class="section home-section-<?php echo $video_background_section;?>  onetone-youtube-section video-section">
<div id="onetone-youtube-video" class="onetone-player" data-property="{videoURL:'<?php echo $section_background_video;?>',containment:'<?php echo $containment;?>', showControls:false, autoPlay:<?php echo $youtube_autoplay;?>, loop:<?php echo $youtube_loop;?>, mute:<?php echo $youtube_mute;?>, startAt:<?php echo $start_play;?>, opacity:1, addRaster:true, quality:'default'}"></div>

  	<div class="bg-video"></div>
  
    <?php get_template_part('home-sections/section',$video_background_section);?>
  <div class="clear"></div>
   <?php 
	  if(  $video_controls == 1  ){
		  $detect = new Mobile_Detect;
		  if(  !$detect->isMobile() && !$detect->isTablet() ){
			  
			  if( $youtube_autoplay == 'true' )
			  $play_btn_icon = 'pause';
			  else
			  $play_btn_icon = 'play';
			  
			  if( $youtube_mute == 'true' )
			  $mute_btn_icon = 'volume-off';
			  else
			  $mute_btn_icon = 'volume-up';
			  
	  echo '<script>function changeLabel(state){
		    if( state == 1 )
			 jQuery("#togglePlay i").removeClass("fa-play").addClass("fa-pause");
			else
			jQuery("#togglePlay i").removeClass("fa-pause").addClass("fa-play");
            
        }
		function toggleVolume(){
			var volume =jQuery(\'#onetone-youtube-video\').YTPToggleVolume();
			if( volume == true )
			jQuery(".youtube-volume i").removeClass("fa-volume-off").addClass("fa-volume-up");
			else
			jQuery(".youtube-volume i").removeClass("fa-volume-up").addClass("fa-volume-off");
			
		}
		
		</script>
		<div class="black-65" id="video-controls">
		  <a class="youtube-pause command" id="togglePlay" href="javascript:;" onclick="jQuery(\'#onetone-youtube-video\').YTPTogglePlay(changeLabel)"><i class="fa fa-'.$play_btn_icon.'"></i></a>
		  <a class="youtube-volume" href="javascript:;" onclick="toggleVolume();"><i class="fa fa-'.$mute_btn_icon.' "></i></a>
	  </div>';
	 }
	  }
	 
	  
	 ?>
</section><file_sep>/sidebar-woo_products_right.php
<?php
    $right_sidebar = esc_attr(onetone_option('right_sidebar_woo_products',''));

	 if ( $right_sidebar && is_active_sidebar( $right_sidebar ) ){
	    dynamic_sidebar( $right_sidebar );
	 }
	 elseif( is_active_sidebar( 'default_sidebar' ) ) {
	    dynamic_sidebar('default_sidebar');
	 }<file_sep>/includes/metabox-options.php
<?php

/**
 * Calls the class on the post edit screen.
 */
function onetone_call_metaboxClass() {
    new onetone_metaboxClass();
}

if ( is_admin() ) {
    add_action( 'load-post.php', 'onetone_call_metaboxClass' );
    add_action( 'load-post-new.php', 'onetone_call_metaboxClass' );
}

/** 
 * The Class.
 */
class onetone_metaboxClass {

	/**
	 * Hook into the appropriate actions when the class is constructed.
	 */
	public function __construct() {
		add_action( 'add_meta_boxes', array( $this, 'onetone_add_meta_box' ) );
		add_action( 'save_post', array( $this, 'onetone_save' ) );
	}

	/**
	 * Adds the meta box container.
	 */
	public function onetone_add_meta_box( $post_type ) {
            $post_types = array( 'page');     //limit meta box to certain post types
            if ( in_array( $post_type, $post_types )) {
		add_meta_box(
			'onetone_page_meta_box'
			,__( 'Onetone Metabox Options', 'onetone' )
			,array( $this, 'onetone_render_meta_box_content' )
			,$post_type
			,'advanced'
			,'high'
		);
            }
	}
// get onetone sliders from plugin magee shrotcodes

 public static function onetone_sliders_meta(){
	 $onetone_sliders[] = array(
            'label'       => __( 'Select a slider', 'onetone' ),
            'value'       => ''
          );
	$onetone_custom_slider = new WP_Query( array( 'post_type' => 'magee_slider', 'post_status'=>'publish', 'posts_per_page' => -1 ) );
	while ( $onetone_custom_slider->have_posts() ) {
		$onetone_custom_slider->the_post();

		$onetone_sliders[] = array(
            'label'       => get_the_title(),
            'value'       => get_the_ID()
          );
	}
	wp_reset_postdata();
	return $onetone_sliders;
	 }
  
	/**
	 * Save the meta when the post is saved.
	 *
	 * @param int $post_id The ID of the post being saved.
	 */
	public function onetone_save( $post_id ) {
	
		/*
		 * We need to verify this came from the our screen and with proper authorization,
		 * because save_post can be triggered at other times.
		 */
		

		// Check if our nonce is set.
		if ( ! isset( $_POST['onetone_inner_custom_box_nonce'] ) )
			return $post_id;

		$nonce = $_POST['onetone_inner_custom_box_nonce'];

		// Verify that the nonce is valid.
		if ( ! wp_verify_nonce( $nonce, 'onetone_inner_custom_box' ) )
			return $post_id;
			
			

		// If this is an autosave, our form has not been submitted,
                //     so we don't want to do anything.
		if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) 
			return $post_id;

		// Check the user's permissions.
		if ( 'page' == $_POST['post_type'] ) {

			if ( ! current_user_can( 'edit_page', $post_id ) )
				return $post_id;
	
		} else {

			if ( ! current_user_can( 'edit_post', $post_id ) )
				return $post_id;
		}


		/* OK, its safe for us to save the data now. */

		// Sanitize the user input.
		//$show_breadcrumb        = sanitize_text_field( $_POST['onetone_show_breadcrumb'] );
		//$onetone_layout          = sanitize_text_field( $_POST['onetone_layout'] );

		if( isset($_POST) && $_POST ){
			
			
		$post_metas                      = array();
		$post_metas['header_position']   =  isset($_POST['header_position'])?$_POST['header_position']:'top';
		$post_metas['full_width']        =  isset($_POST['full_width'])?$_POST['full_width']:'no';
		$post_metas['padding_top']       =  isset($_POST['padding_top'])?$_POST['padding_top']:'';
		$post_metas['padding_bottom']    =  isset($_POST['padding_bottom'])?$_POST['padding_bottom']:'';
		$post_metas['display_breadcrumb'] =  isset($_POST['display_breadcrumb'])?$_POST['display_breadcrumb']:'';
		$post_metas['nav_menu']          =  isset($_POST['nav_menu'])?$_POST['nav_menu']:'';
		$post_metas['page_layout']       =  isset($_POST['page_layout'])?$_POST['page_layout']:'none';
		$post_metas['left_sidebar']      =  isset($_POST['left_sidebar'])?$_POST['left_sidebar']:'';
		$post_metas['right_sidebar']     =  isset($_POST['right_sidebar'])?$_POST['right_sidebar']:'';
		$post_metas['slider_banner']     =  isset($_POST['slider_banner'])?$_POST['slider_banner']:'0';
		$post_metas['banner_position']   =  isset($_POST['banner_position'])?$_POST['banner_position']:'1';
		$post_metas['magee_slider']      =  isset($_POST['magee_slider'])?$_POST['magee_slider']:'';
		$post_metas['display_title']     =  isset($_POST['display_title'])?$_POST['display_title']:'yes';
		$post_metas['display_title_bar'] =  isset($_POST['display_title_bar'])?$_POST['display_title_bar']:'0';
			 
		$onetone_post_meta = json_encode( $post_metas );
		// Update the meta field.
		update_post_meta( $post_id, '_onetone_post_meta', $onetone_post_meta );
		}

	
	}


	/**
	 * Render Meta Box content.
	 *
	 * @param WP_Post $post The post object.
	 */
	public function onetone_render_meta_box_content( $post ) {
	
	   global $wp_registered_sidebars;
	   
	 //  $magee_sliders = self::onetone_sliders_meta();
	   
		// Add an nonce field so we can check for it later.
		wp_nonce_field( 'onetone_inner_custom_box', 'onetone_inner_custom_box_nonce' );

		// Use get_post_meta to retrieve an existing value from the database.
	    $page_meta  = get_post_meta( $post->ID ,'_onetone_post_meta',true);
		$page_metas = @json_decode( $page_meta,true );
		if( $page_metas )
	    extract( $page_metas );
		
	
		/************ get nav menus*************/
		
		$nav_menus[] = array(
            'label'       => __( 'Default', 'onetone' ),
            'value'       => ''
          );
		$menus = get_registered_nav_menus();
		
		foreach ( $menus as $location => $description ) {
		$nav_menus[] = array(
					'label'       => $description,
					'value'       => $location
				  );
			
		}
		
		/* sidebars */

	  $sidebars[] = array(
				  'label'       => __( 'None', 'onetone' ),
				  'value'       => ''
				);
	  
	  foreach( $wp_registered_sidebars as $key => $value){
		  
		  $sidebars[] = array(
				  'label'       => $value['name'],
				  'value'       => $value['id'],
				);
		  }
		  
		// Display the form, using the current value.
		$full_width         = isset( $full_width )? $full_width:'no'; 
		$page_layout        = isset( $page_layout )? $page_layout:'none'; 
		$left_sidebar       = isset( $left_sidebar )? $left_sidebar:''; 
		$right_sidebar      = isset( $right_sidebar )? $right_sidebar:''; 
		$display_breadcrumb = isset( $display_breadcrumb )? $display_breadcrumb:''; 
		$display_title      = isset( $display_title )? $display_title:'yes'; 
		$display_title_bar  = isset( $display_title_bar )? $display_title_bar:''; 
		$padding_top         = isset( $padding_top )? $padding_top:'50px';
		$padding_bottom      = isset( $padding_bottom )? $padding_top:'50px';
		
		echo '<p class="meta-options"><label for="full_width"  style="display: inline-block;width: 150px;">';
		_e( 'Content Full Width', 'onetone' );
		echo '</label> ';
		echo '<select name="full_width" id="full_width">
		<option '.selected($full_width,'no',false).' value="no">'.__("No","onetone").'</option>
		<option '.selected($full_width,'yes',false).' value="yes">'.__("Yes","onetone").'</option>
		</select></p>';
		
		echo '<p class="meta-options"><label for="padding_top"  style="display: inline-block;width: 150px;">';
		_e( 'Padding Top', 'onetone' );
		echo '</label> ';
		echo '<input name="padding_top" type="text" value="'.$padding_top.'" />';
		echo '</p>';
		
		echo '<p class="meta-options"><label for="padding_bottom"  style="display: inline-block;width: 150px;">';
		_e( 'Padding Bottom', 'onetone' );
		echo '</label> ';
		echo '<input name="padding_bottom" type="text" value="'.$padding_bottom.'" />';
		echo '</p>';
		
		
		echo '<p class="meta-options"><label for="display_breadcrumb"  style="display: inline-block;width: 150px;">';
		_e( 'Display Title Bar', 'onetone' );
		echo '</label> ';
		echo '<select name="display_title_bar" id="display_title_bar">
		<option '.selected($display_title_bar,'',false).' value="" selected>'.__("Default","onetone").'</option>
		<option '.selected($display_title_bar,'yes',false).' value="yes">'.__("Yes","onetone").'</option>
		<option '.selected($display_title_bar,'no',false).' value="no">'.__("No","onetone").'</option>
		</select></p>';
		
		
		echo '<p class="meta-options"><label for="display_breadcrumb"  style="display: inline-block;width: 150px;">';
		_e( 'Display Breadcrumb', 'onetone' );
		echo '</label> ';
		echo '<select name="display_breadcrumb" id="display_breadcrumb">
		<option '.selected($display_breadcrumb,'',false).' value="">'.__("Default","onetone").'</option>
		<option '.selected($display_breadcrumb,'yes',false).' value="yes">'.__("Yes","onetone").'</option>
		<option '.selected($display_breadcrumb,'no',false).' value="no">'.__("No","onetone").'</option>
		</select></p>';
		
				
		
		echo '<p class="meta-options"><label for="page_layout"  style="display: inline-block;width: 150px;">';
		_e( 'Page Layout', 'onetone' );
		echo '</label> ';
		echo '<select name="page_layout" id="page_layout">
		<option '.selected($page_layout,'none',false).' value="none">'.__("No Sidebar","onetone").'</option>
		<option '.selected($page_layout,'left',false).' value="left">'.__("Left Sidebar","onetone").'</option>
		<option '.selected($page_layout,'right',false).' value="right">'.__("Right Sidebar","onetone").'</option>
		<option '.selected($page_layout,'both',false).' value="both">'.__("Both Sidebar","onetone").'</option>
		</select></p>';
		
		
		echo '<p class="meta-options"><label for="left_sidebar"  style="display: inline-block;width: 150px;">';
		_e( 'Select Left Sidebar', 'onetone' );
		echo '</label> ';
		echo '<select name="left_sidebar" id="left_sidebar">';
		foreach( $sidebars as $sidebar ){
		echo '<option '.selected($left_sidebar,$sidebar['value'],false).' value="'.$sidebar['value'].'">'.$sidebar['label'].'</option>';
		}
		echo '</select></p>';
		
		echo '<p class="meta-options"><label for="right_sidebar"  style="display: inline-block;width: 150px;">';
		_e( 'Select Right Sidebar', 'onetone' );
		echo '</label> ';
		echo '<select name="right_sidebar" id="right_sidebar">';
		foreach( $sidebars as $sidebar ){
		echo '<option '.selected($right_sidebar,$sidebar['value'],false).' value="'.$sidebar['value'].'">'.$sidebar['label'].'</option>';
		}
		echo '</select></p>';
		
		
		
	}
}<file_sep>/woocommerce/config.php
<?php

define( "WOO_IMAGES", get_template_directory_uri() . "/woocommerce/images" );


remove_action( 'woocommerce_before_main_content','woocommerce_breadcrumb', 20, 0);
//add_action( 'onetone_before_content_wrap','woocommerce_breadcrumb');

remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);

remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
add_action( 'woocommerce_before_main_content', 'onetone_woocommerce_output_content_wrapper', 10);
add_action( 'woocommerce_after_main_content', 'onetone_woocommerce_output_content_wrapper_end', 10);

add_action( 'woocommerce_before_shop_loop', 'onetone_woocommerce_before_shop_loop', 0,0);
add_action( 'woocommerce_before_shop_loop', 'onetone_woocommerce_after_shop_loop', 40);

remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10);
add_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_sale_flash', 10);

//add_action( 'onetone_woocommerce_after_catalog_ordering', 'onetone_after_catalog_ordering', 40);

//remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
//remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
//remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating' ,5);

add_action('woocommerce_sidebar','onetone_woocommerce_sidebar');

add_action( 'woocommerce_after_product_loop','onetone_get_portfolio_share_icons');
add_action('woocommerce_share','onetone_single_product_sharing');

add_action('onetone_header_shopping_cart','onetone_header_shopping_cart');

add_action('woocommerce_before_shop_loop_item_title','onetone_before_shop_loop_item_title');
add_action('woocommerce_after_shop_loop_item','onetone_after_shop_loop_item');



function onetone_woocommerce_sidebar(){
	
	}
function onetone_before_shop_loop_item_title(){
	
	echo '<div class="product-info text-center">';
	}
function onetone_after_shop_loop_item(){
	
	echo '</div>';
	}

function onetone_after_catalog_ordering(){
	
	}
function onetone_woocommerce_before_shop_loop(){
echo "<div class='product-page-title-container'>";
}
function onetone_woocommerce_after_shop_loop(){
echo "</div>";
}


function onetone_single_product_sharing(){
	
	}


function onetone_woocommerce_output_content_wrapper() {
    global $woocommerce;
 
  $sidebar ='';

 if(is_single())
 {
 $left_sidebar  =	onetone_option('left_sidebar_woo_products','');
 $right_sidebar =	onetone_option('right_sidebar_woo_products','');
 
 }else {
 $left_sidebar  =	onetone_option('left_sidebar_woo_archive','');
 $right_sidebar =	onetone_option('right_sidebar_woo_archive','');
 }
 
if( $left_sidebar )
$sidebar = 'left';
if( $right_sidebar )
$sidebar = 'right';
if( $left_sidebar && $right_sidebar )
$sidebar = 'both';

$aside          = 'no-aside';
if( $left_sidebar !='' )
$aside          = 'left-aside';
if( $right_sidebar !='' )
$aside          = 'right-aside';
if(  $left_sidebar !='' && $right_sidebar !='' )
$aside          = 'both-aside';


echo '<div class="col-md-12">';
do_action("onetone_before_content_wrap");
echo '</div>';

?>
<section class="page-title-bar title-left no-subtitle" style="">
            <div class="container">
                <hgroup class="page-title">
                <?php if(is_shop()):?>
			       <h1><?php woocommerce_page_title(); ?></h1>
                   <?php elseif( is_product_category() || is_product_tag() ):?>
                   <h1><?php single_term_title();?></h1>
                   <?php else:?>
                   <h1><?php the_title(); ?></h1>
                   <?php endif; ?>
                   
                </hgroup>
                <?php woocommerce_breadcrumb(array("before"=>"","after"=>"","wrap_before"=>"<div class='breadcrumb-nav breadcrumbs' itemprop='breadcrumb'>","delimiter"=>' / ','wrap_after'=>'</div>'));?> 
                <div class="clearfix"></div>            
            </div>
        </section>


<div class="post-wrap">
            <div class="container">
                <div class="post-inner row <?php echo $aside; ?>">
                    <div class="col-main">
                        <section class="post-main" role="main" id="content">
                            <div class="woo-product clearfix">
                                <div class="post-attributes">
                       

<?php
}
function onetone_woocommerce_output_content_wrapper_end() {
	
	 if(is_single())
 {
 $left_sidebar  =	onetone_option('left_sidebar_woo_products','');
 $right_sidebar =	onetone_option('right_sidebar_woo_products','');
 $sidebar_l     =   'woo_products_left';
 $sidebar_r     =   'woo_products_right';
 
 }else {
 $left_sidebar  =	onetone_option('left_sidebar_woo_archive','');
 $right_sidebar =	onetone_option('right_sidebar_woo_archive','');
 $sidebar_l     =   'woo_archive_left';
 $sidebar_r     =   'woo_archive_right';
 }
 
echo '</div>
</div></section></div>';

 if( $left_sidebar !='' ):?>
                    <div class="col-aside-left">
                        <aside class="blog-side left text-left">
                            <div class="widget-area">
                                <?php get_sidebar( $sidebar_l );?> 
                            </div>
                        </aside>
                    </div>
                    <?php endif; ?>
                    <?php if( $right_sidebar !='' ):?>
                    <div class="col-aside-right">
                       <?php get_sidebar( $sidebar_r );?>
                    </div>
<?php endif;

echo '</div></div></div>';

}


function onetone_woocommerce_styles(){
	if(is_admin() || 'wp-login.php' == basename($_SERVER['PHP_SELF'])){
		return;
	}
	//wp_enqueue_style('onetone-woocommerce', get_template_directory_uri().'/style/woocommerce.css', false, false, 'all');
	
}
add_action('wp_print_styles', 'onetone_woocommerce_styles',12);


add_filter('add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment');
 
function woocommerce_header_add_to_cart_fragment( $fragments ) {
	global $woocommerce;
	
	ob_start();
	
	?>
	<a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a>
	<?php
	
	$fragments['a.cart-contents'] = ob_get_clean();
	
	return $fragments;
	
}


/*--------------------------------------------------------------------------------------------------
	PRODUCTS PAGE - FILTER IMAGE
--------------------------------------------------------------------------------------------------*/
 
if ( ! function_exists( 'woocommerce_template_loop_product_thumbnail' ) ) {

	function woocommerce_template_loop_product_thumbnail() {
		echo woocommerce_get_product_thumbnail();
	} 
}
if ( ! function_exists( 'woocommerce_get_product_thumbnail' ) ) {

	function woocommerce_get_product_thumbnail( $size = 'shop_catalog', $placeholder_width = 500, $placeholder_height = 500  ) {
		global $post, $woocommerce, $shop_style;
		
		$items_in_cart = array();

		if ( $woocommerce->cart->get_cart() && is_array( $woocommerce->cart->get_cart() ) ) {
			foreach ( $woocommerce->cart->get_cart() as $cart ) {
				$items_in_cart[] = $cart['product_id'];
			}
		}

		$id      = get_the_ID();
		$in_cart = in_array( $id, $items_in_cart );
		$size    = 'shop_catalog';
		
		$gallery          = get_post_meta( $id, '_product_image_gallery', true );
		$attachment_image = '';
		if ( ! empty( $gallery ) ) {
			$gallery          = explode( ',', $gallery );
			$first_image_id   = $gallery[0];
			$attachment_image = wp_get_attachment_image( $first_image_id, $size, false, array( 'class' => 'hover-image' ) );
		}
		
		if( $shop_style == 1 ):
		$output = '<div class="product-image">';
			
			if ( has_post_thumbnail() ) {
				$thumb = get_the_post_thumbnail( get_the_ID() , "shop_catalog" ); 
				
				 $output .= '<div class="product-image-front">
							  '.$thumb.'
						  </div>
						  <div class="product-image-back">
							  '.$attachment_image.'
						  </div>';
						  
						  
				
			} else {
			
				$output .= '<img src="'. woocommerce_placeholder_img_src() .'" alt="Placeholder" width="'.$placeholder_width.'" height="'.$placeholder_height.'" />';
			
			}
			
			$output .= '<div class="product-image-overlay"></div>
					  </div>';
		else:
		
		if ( has_post_thumbnail() ) {
			
	
				$thumb = get_the_post_thumbnail( get_the_ID() , "shop_catalog" ); 
				
				 $image = '<div class="product-image-front">
							  '.$thumb.'
						  </div>
						  <div class="product-image-back">
							  '.$attachment_image.'
						  </div>';
						  
						  
				
			} else {
			
				$image = '<img src="'. woocommerce_placeholder_img_src() .'" alt="Placeholder" width="'.$placeholder_width.'" height="'.$placeholder_height.'" />';
			
			}
		
		$output = '<div class="product-image"><a href="'.get_permalink().'">'.$image.'
                                                        
                                                        <div class="product-image-overlay"></div>
                                                        </a>
														
														<div class="product-action"><a href="#">
                                                            </a>';
															
															
	//	$output .= '<a href="#" class="add_to_cart_button"><i class="fa fa-shopping-cart"></i> ADD TO CART</a>';
		global $product;

$icon = $product->is_purchasable() && $product->is_in_stock() ? '<i class="fa fa-shopping-cart"></i>':'';

$output .= apply_filters( 'woocommerce_loop_add_to_cart_link',
	sprintf( '<a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" data-quantity="%s" class="button %s product_type_%s">%s</a>',
		esc_url( $product->add_to_cart_url() ),
		esc_attr( $product->id ),
		esc_attr( $product->get_sku() ),
		esc_attr( isset( $quantity ) ? $quantity : 1 ),
		$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',
		esc_attr( $product->product_type ),
		 $icon.' '.esc_html( $product->add_to_cart_text() )
	),
$product );

        $output .= '</div></div>';
		
		endif;
			
			return $output;
	}
}

 
function onetone_short_desc_filter($content){   


    $content = str_replace ('<p>','<p class="desc">',$content);
    return $content;
}

add_filter('woocommerce_short_description', 'onetone_short_desc_filter');

function onetone_url_set_value($url,$key,$value)
{
	$a=explode('?',$url);
	$url_f=$a[0];
	$query=isset($a[1])?$a[1]:"";
	parse_str($query,$arr);
	$arr[$key]=$value;
	return $url_f.'?'.http_build_query($arr);
} 

function onetone_get_self_url(){    
    if (isset($_SERVER['REQUEST_URI']))  
    {  
        $serverrequri = $_SERVER['REQUEST_URI'];   
    }  
    else  
    {  
        if (isset($_SERVER['argv']))  
        {  
            $serverrequri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['argv'][0];  
        }  
        else if(isset($_SERVER['QUERY_STRING']))  
        {  
            $serverrequri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['QUERY_STRING'];  
        }  
    }  
    $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";  
    $protocol = strstr(strtolower($_SERVER["SERVER_PROTOCOL"]), "/",true).$s;  
    $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);  
    return $protocol."://".$_SERVER['SERVER_NAME'].$port.$serverrequri;     
} 


function onetone_header_shopping_cart(){
global $woocommerce;


			}
			

	/**
	 * Register the [woocommerce_recently_viewed_products per_page="5"] shortcode
	 *
	 * This shortcode displays recently viewed products using WooCommerce default cookie
	 * It only has one parameter "per_page" to choose number of items to show
	 *
	 * @access      public
	 * @since       1.0
	 * @return      $content
	*/
	function onetone_woocommerce_recently_viewed_products(  ) {
	 
	  
	
	 
	    // Get WooCommerce Global
	    global $woocommerce;
	 
	    // Get recently viewed product cookies data
	    $viewed_products = ! empty( $_COOKIE['woocommerce_recently_viewed'] ) ? (array) explode( '|', $_COOKIE['woocommerce_recently_viewed'] ) : array();
	    $viewed_products = array_filter( array_map( 'absint', $viewed_products ) );
	 
	    // If no data, quit
	    if ( empty( $viewed_products ) )
	        return __( 'You have not viewed any product yet!', 'onetone' );
	 
	    // Create the object
	
	 
	    // Get products per page
	    if( !isset( $per_page ) ? $number = 4 : $number = $per_page )
	 
	    // Create query arguments array
	    $query_args = array(
	                    'posts_per_page' => $number,
	                    'no_found_rows'  => 1,
	                    'post_status'    => 'publish',
	                    'post_type'      => 'product',
	                    'post__in'       => $viewed_products,
	                    'orderby'        => 'rand'
	                    );
	 
	    // Add meta_query to query args
	    $query_args['meta_query'] = array();
	 
	    // Check products stock status
	    $query_args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
	 
	    // Create a new query
	    $r = new WP_Query($query_args);
	 
	    // If query return results
	    if ( $r->have_posts() ) {
	 
	       woocommerce_product_loop_start();
	 
	        // Start the loop
	        while ( $r->have_posts()) {
	            $r->the_post();
	            wc_get_template_part( 'content', 'product' );
	 
	    }
		woocommerce_product_loop_end();
		}
		wp_reset_query();
	
	}

	add_action("woocommerce_cart_is_empty", "onetone_woocommerce_recently_viewed_products");
	
	function onetone_before_cart(){}
	add_action("woocommerce_before_cart", "onetone_before_cart",0);
	
	function onetone_before_checkout_form(){}
	add_action("woocommerce_before_checkout_form", "onetone_before_checkout_form",20);
	
	function onetone_before_thankyou(){}
	add_action("woocommerce_before_thankyou", "onetone_before_thankyou");
	
	function onetone_after_nav_menu(){}
		
	add_action("onetone_before_nav_menu", "onetone_after_nav_menu");<file_sep>/content-article.php
<div class="entry-box-wrap" id="post-<?php the_ID(); ?>">
                                        <article class="entry-box" role="article">
                                        <?php if (  has_post_thumbnail() ): ?>
                                            <div class="feature-img-box">
                                                <div class="img-box figcaption-middle text-center from-top fade-in">
                                                    <a href="<?php the_permalink();?>">
                                                        <?php the_post_thumbnail();?>
                                                        <div class="img-overlay dark">
                                                            <div class="img-overlay-container">
                                                                <div class="img-overlay-content">
                                                                    <i class="fa fa-link"></i>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </a>
                                                </div>                                                 
                                            </div>
                                            <?php endif;?>
                                            <div class="entry-main">
                                                <div class="entry-header">
                                                    <a href="<?php the_permalink();?>"><h1 class="entry-title"><?php the_title();?></h1></a>
                                                    <ul class="entry-meta">
                                                        <li class="entry-date"><i class="fa fa-calendar"></i><a href="<?php echo get_month_link(get_the_time('Y'), get_the_time('m'));?>"><?php echo get_the_date("M d, Y");?></a></li>
                                                        <li class="entry-author"><i class="fa fa-user"></i><?php echo get_the_author_link();?></li>
                                                        <li class="entry-catagory"><i class="fa fa-file-o"></i><?php the_category(', '); ?></li>
                                                        <li class="entry-comments"><i class="fa fa-comment"></i><a href="<?php the_permalink();?>#comments"><?php  comments_popup_link( __('No comments yet','onetone'), __('1 comment','onetone'), __('% comments','onetone'), 'comments-link', '');?></a></li>
                                                    </ul>
                                                </div>
                                                <div class="entry-summary">
                                                   <?php the_excerpt();?>
                                                </div>
                                                <div class="entry-footer">
                                                    <a href="<?php the_permalink();?>" class="entry-more pull-right"><?php _e("Read More","onetone");?> &gt;&gt;</a>
                                                </div>
                                            </div>
                                        </article>
                                    </div><file_sep>/functions.php
<?php
//Jesus: remove autoformating in pages
function custom_wpautop($content) {
  if (is_attachment() || is_single()) {
    return wpautop($content);
  } else {
    return $content;
  }
}

remove_filter('the_content', 'wpautop');
add_filter('the_content', 'custom_wpautop');

//Jesus: remove admin bar in front
function my_function_admin_bar(){ return false; }
add_filter( 'show_admin_bar' , 'my_function_admin_bar');
?>

<?php

define( 'ONETONE_THEME_BASE_URL', get_template_directory_uri());
define( 'ONETONE_OPTIONS_FRAMEWORK', get_template_directory().'/admin/' ); 
define( 'ONETONE_OPTIONS_FRAMEWORK_URI',  ONETONE_THEME_BASE_URL. '/admin/'); 
define( 'ONETONE_OPTIONS_PREFIXED' ,'onetone_' );


define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/admin/' );
require_once dirname( __FILE__ ) . '/admin/options-framework.php';


/**
 * google fonts
 **/
 
load_template( trailingslashit( get_template_directory() ) . 'includes/google-fonts.php' );


require_once get_template_directory() . '/includes/admin-options.php';
/**
 * Theme Functions
 **/
 
load_template( trailingslashit( get_template_directory() ) . 'includes/theme-functions.php' );





/**
 * Required: include options framework.
 **/
load_template( trailingslashit( get_template_directory() ) . 'admin/options-framework.php' );

/**
 * Mobile Detect Library
 **/
 if(!class_exists("Mobile_Detect")){
   load_template( trailingslashit( get_template_directory() ) . 'includes/Mobile_Detect.php' );
 }
/**
 * Theme setup
 **/
 
load_template( trailingslashit( get_template_directory() ) . 'includes/theme-setup.php' );




/**
 * Onetone Shortcodes
 **/
 
load_template( trailingslashit( get_template_directory() ) . 'includes/shortcodes.php' );


/**
 * Theme breadcrumb
 */
load_template( trailingslashit( get_template_directory() ) . 'includes/breadcrumb-trail.php');

/**
 * Theme widget
 **/
 
load_template( trailingslashit( get_template_directory() ) . 'includes/theme-widget.php' );

/**
 * Meta box
 **/
 
load_template( trailingslashit( get_template_directory() ) . 'includes/metabox-options.php' );



 /**
 * Woocommerce template
 **/
 

if (class_exists('WooCommerce')) {
	require_once ( get_template_directory() .'/woocommerce/config.php' );
	}
	

/**
 * Magee Importer
 */
 
require get_template_directory() . '/lib/importer/importer.php';


/**
 * Magee shortcodes
 */
if( ! class_exists( 'Magee_Core' ) ) 
require get_template_directory() . '/lib/magee-shortcodes-pro/Magee.php';
	


add_filter('widget_text', 'do_shortcode');


function onetone_deactivate_plugin_conditional() {
    if ( is_plugin_active('magee-shortcodes/Magee.php') ) {
    deactivate_plugins('magee-shortcodes/Magee.php');    
    }
	if ( is_plugin_active('magee-shortcodes-pro/Magee.php') ) {
    deactivate_plugins('magee-shortcodes-pro/Magee.php');    
    }
}
add_action( 'admin_init', 'onetone_deactivate_plugin_conditional' );<file_sep>/home-sections/section-html5-video.php
<?php
$video_background_section  = onetone_option( 'video_background_section' );
 $i                   = $video_background_section-1 ;
 $section_title       = onetone_option( 'section_title_'.$i );
 $section_menu        = onetone_option( 'menu_title_'.$i );
 $parallax_scrolling  = onetone_option( 'parallax_scrolling_'.$i );
 $section_css_class   = onetone_option( 'section_css_class_'.$i );
 $section_content     = onetone_option( 'section_content_'.$i );
 $full_width          = onetone_option( 'full_width_'.$i );
 
 $section_subtitle    = onetone_option( 'section_subtitle_'.$i );
 $mp4_video_url       = onetone_option( 'mp4_video_url' );
 $ogv_video_url       = onetone_option( 'ogv_video_url' );
 $webm_video_url      = onetone_option( 'webm_video_url' );
 $poster_url          = onetone_option( 'poster_url' );
 $video_loop          = onetone_option( 'video_loop' );
 $video_volume        = onetone_option( 'video_volume' );
 $video_volume        = $video_volume == "" ? 0.8 : $video_volume ;
	
  if( !isset($section_content) || $section_content=="" ) 
  $section_content = onetone_option( 'sction_content_'.$i );
  
  $section_id      = sanitize_title( onetone_option( 'menu_slug_'.$i ,'section-'.($i+1) ) );
  if( $section_id == '' )
   $section_id = 'section-'.($i+1);
  
  $container_class = "container";
  if( $full_width == "yes" ){
  $container_class = "";
  }
 if( $parallax_scrolling == "yes" || $parallax_scrolling == "1" ){
	 $section_css_class  .= ' onetone-parallax';
  }
?>
<section id="<?php echo $section_id; ?>" class="section home-section-<?php echo $video_background_section;?> <?php echo $section_css_class;?> onetone-html5-section video-section">
 <?php get_template_part('home-sections/section',$video_background_section);?>
  <div class="clear"></div>
  <?php 
	
		 $header_cover_video_background_html5 = onetone_option( "header_cover_video_background_html5" ,1);
		 if( $video_loop == 1 ){
		    $video_loop = "true";
		  }
		else{
		    $video_loop = "false";	
			}
	
		 echo '<script type="text/javascript" src="'.get_template_directory_uri().'/plugins/jquery-ui.min.js"></script>';
		 echo '<script type="text/javascript" src="'.get_template_directory_uri().'/plugins/video.js"></script>';
		 echo '<script type="text/javascript" src="'.get_template_directory_uri().'/plugins/bigvideo.js"></script>'; 
		 
		 echo '<script type="text/javascript" > 
		    var BV;
            var BV = new jQuery.BigVideo({
				useFlashForFirefox:false,
				forceAutoplay:true,
				controls:false,
				doLoop:'.$video_loop.',
				';
				if( $header_cover_video_background_html5 == '0'){
					echo 'container:jQuery(".onetone-html5-section")';
				}
			echo '});
			BV.init();';
			
		//	echo 'if (Modernizr.touch) { BV.show("'.$poster_url.'"); } else {';
			
			echo 'BV.show(
				[
					{ type: "video/mp4",  src: "'.$mp4_video_url.'" },
					{ type: "video/webm", src: "'.$webm_video_url.'" },
					{ type: "video/ogg",  src: "'.$ogv_video_url.'" }
				],{ambient:'.$video_loop.'});
				BV.getPlayer().volume('.$video_volume.');
				BV.getPlayer().on("durationchange",function(){jQuery("#big-video-wrap").fadeIn();});';
	
		//echo '}';
		
	  echo '</script>';
	  wp_localize_script( 'onetone-default', 'onetone_video',array('header_cover_video_background_html5'=>$header_cover_video_background_html5));

	 ?>
</section><file_sep>/includes/theme-functions.php
<?php

 	/*	
	*	get background 
	*	---------------------------------------------------------------------
	*/
function onetone_get_background($args){
$background = "";
 if (is_array($args)) {
	if (isset($args['image']) && $args['image']!="") {
  // Jesús: Changed becouse don´t work well
	//$background .=  "background:url(".$args['image']. ")  ".$args['repeat']." ".$args['position']." ".$args['attachment'].";";
    
  // New code
	$background .=  "background-image:url(".$args['image']. ");";    
	if( !$parallax_scrolling == "yes" || !$parallax_scrolling == "1" ){
    $background .=  "background-repeat:".$args['repeat']. ";";
    $background .=  "background-position:".$args['position']. ";";
    $background .=  "background-attachment:".$args['attachment']. ";";
	 }
  //
	}
	
	if(isset($args['color']) && $args['color'] !=""){
	$background .= "background-color:".$args['color'].";";
	}
	}

return $background;
}


/*	
	*	send email
	*	---------------------------------------------------------------------
	*/
function onetone_contact(){
	if(trim($_POST['Name']) === '') {
		$Error = __('Please enter your name.','onetone');
		$hasError = true;
	} else {
		$name = trim($_POST['Name']);
	}

	if(trim($_POST['Email']) === '')  {
		$Error = __('Please enter your email address.','onetone');
		$hasError = true;
	} else if (!preg_match("/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$/i", trim($_POST['Email']))) {
		$Error = __('You entered an invalid email address.','onetone');
		$hasError = true;
	} else {
		$email = trim($_POST['Email']);
	}

	if(trim($_POST['Message']) === '') {
		$Error =  __('Please enter a message.','onetone');
		$hasError = true;
	} else {
		if(function_exists('stripslashes')) {
			$message = stripslashes(trim($_POST['Message']));
		} else {
			$message = trim($_POST['Message']);
		}
	}

	if(!isset($hasError)) {
		
	   if (isset($_POST['sendto']) && preg_match("/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$/i", trim(base64_decode($_POST['sendto'])))) {
	     $emailTo = base64_decode($_POST['sendto']);
	   }
	   else{
	 	 $emailTo = get_option('admin_email');
		}
		 if($emailTo !=""){
		$subject = 'From '.$name;
		$body = "Name: $name \n\nEmail: $email \n\nMessage: $message";
		$headers = 'From: '.$name.' <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email;

		wp_mail($emailTo, $subject, $body, $headers);
		$emailSent = true;
		}
		echo json_encode(array("msg"=>__("Your message has been successfully sent!","onetone"),"error"=>0));
		
	}
	else
	{
	echo json_encode(array("msg"=>$Error,"error"=>1));
	}
	die() ;
	}
	add_action('wp_ajax_onetone_contact', 'onetone_contact');
	add_action('wp_ajax_nopriv_onetone_contact', 'onetone_contact');
	
	
	function onetone_contact_advanced(){


    $body  = '';
	$email = '';
	
	   if (isset($_POST['sendto']) && preg_match("/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$/i", trim(base64_decode($_POST['sendto'])))) {
	     $emailTo = base64_decode($_POST['sendto']);
	   }
	   else{
	 	 $emailTo = get_option('admin_email');
		}
		 if($emailTo !=""){
		$subject = 'From '.get_bloginfo('name');
		
		parse_str($_POST['values'], $values);
		if( is_array($values) ){
		foreach( $values as $k => $v ){
			//$body .= str_replace('_',' ',$k).': '.$v.' <br/><br/>';
			
			$body .= str_replace('_',' ',$k).': '.utf8_encode(htmlentities($v)).' <br/><br/>';
			
			if( strpos(strtolower($k),'email') && $v != "" ){
				$email = $v;
				}
			}
		}
		
		$headers = 'From: '.get_bloginfo('name').' <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email . "\r\n";	
		
		$headers .= "MIME-Version: 1.0\r\n";
        $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
	
		wp_mail($emailTo, $subject, $body, $headers);
		$emailSent = true;
		}
		echo json_encode(array("msg"=>__("Your message has been successfully sent!","onetone"),"error"=>0));
		
	die() ;
	}
	add_action('wp_ajax_onetone_contact_advanced', 'onetone_contact_advanced');
	add_action('wp_ajax_nopriv_onetone_contact_advanced', 'onetone_contact_advanced');
	
	
	
// get breadcrumbs
 function onetone_get_breadcrumb( $options = array()){
   global $post,$wp_query ;
    $postid = isset($post->ID)?$post->ID:"";
	
   $show_breadcrumb = "";
   if ( 'page' == get_option( 'show_on_front' ) && ( '' != get_option( 'page_for_posts' ) ) && $wp_query->get_queried_object_id() == get_option( 'page_for_posts' ) ) { 
    $postid = $wp_query->get_queried_object_id();
   }
  
   if(isset($postid) && is_numeric($postid)){
    $show_breadcrumb = get_post_meta( $postid, '_onetone_show_breadcrumb', true );
	}
	if($show_breadcrumb == 'yes' || $show_breadcrumb==""){

               onetone_breadcrumb_trail( $options);           
	}
	   
	}
	
	
/*
*  page navigation
*
*/
function onetone_native_pagenavi($echo,$wp_query){
    if(!$wp_query){global $wp_query;}
    global $wp_rewrite;      
    $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;
    $pagination = array(
    'base' => @add_query_arg('paged','%#%'),
    'format' => '',
    'total' => $wp_query->max_num_pages,
    'current' => $current,
    'prev_text'    => '<i class="fa fa-angle-double-left"></i>',
	 'next_text'    => '<i class="fa fa-angle-double-right"></i>',
	'type'         => 'list',
    );
 
    if( $wp_rewrite->using_permalinks() )
        $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg('s',get_pagenum_link(1) ) ) . 'page/%#%/', 'paged');
 
    if( !empty($wp_query->query_vars['s']) )
        $pagination['add_args'] = array('s'=>get_query_var('s'));
    if($echo == "echo"){
    echo '<div class="page_navi text-center">'.paginate_links($pagination).'</div>'; 
	}else
	{
	
	return '<div class="page_navi text-center">'.paginate_links($pagination).'</div>';
	}
}
   
    //// Custom comments list
   
   function onetone_comment($comment, $args, $depth) {
   $GLOBALS['comment'] = $comment; ?>
   <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ;?>">
     <div id="comment-<?php comment_ID(); ?>">
     
     <div class="comment media-comment media">
                                                    <div class="media-avatar media-left">
                                                       <?php echo get_avatar($comment,'52','' ); ?>
                                                    </div>
                                                    <div class="media-body">
                                                        <div class="media-inner">
                                                            <h4 class="media-heading clearfix">
                                                                <?php echo get_comment_author_link();?> - <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ;?>">
<?php printf(__('%1$s at %2$s','onetone'), get_comment_date(), get_comment_time()) ;?></a>
                                                                <?php edit_comment_link(__('(Edit)','onetone'),'  ','') ;?>
                                                                <?php comment_reply_link(array_merge( $args, array('reply_text' => '<i class="fa fa-reply"></i> '. __('Reply','onetone'), 'depth' => $depth, 'max_depth' => $args['max_depth']))) ;?>
                                                            </h4>
                                                            
                                                            <?php if ($comment->comment_approved == '0') : ?>
         <em><?php _e('Your comment is awaiting moderation.','onetone') ;?></em>
         <br />
      <?php endif; ?>
                                                           <?php comment_text() ;?>
                                                        </div>
                                                    </div>
                                                </div>
                                <div class="clear"></div>
                           </div>
<?php
        }
		

	
	
	function onetone_get_default_slider(){
	
	$sanitize_title = "home";
	$section_menu   = onetone_option( 'menu_title_0' );
	$section_slug   = onetone_option( 'menu_slug_0' );
	if( $section_menu  != "" ){
    $sanitize_title = sanitize_title($section_menu );
    if( trim($section_slug) !="" ){
	 $sanitize_title = sanitize_title($section_slug); 
	 }
 }	
	 
	$return = '<section id="'.$sanitize_title.'" class="section homepage-slider onetone-'.$sanitize_title.'"><div id="onetone-owl-slider" class="owl-carousel owl-theme">';
	 for($i=1;$i<=5;$i++){
	$active = '';
	
	 $text       = onetone_option('onetone_slide_text_'.$i);
	 $image      = onetone_option('onetone_slide_image_'.$i);
	
     if( $image != "" ){
     $return .= '<div class="item"><img src="'.$image.'" alt=""><div class="inner">'. do_shortcode($text) .'</div></div>';
	 
	 }

	}
	
		$return .= '</div></section>';

        return $return;
		
   }

   /**
 * onetone admin panel menu
 */
 
   add_action( 'optionsframework_page_title_after','onetone_options_page_title' );

function onetone_options_page_title() { ?>

		          <ul class="options-links">
                  <li><a href="<?php echo esc_url( 'http://www.mageewp.com/wordpress-themes' ); ?>" target="_blank"><?php _e( 'MageeWP Themes', 'onetone' ); ?></a></li>
                  <li><a href="<?php echo esc_url( 'http://www.mageewp.com/manuals/theme-guide-onetone.html' ); ?>" target="_blank"><?php _e( 'Manual', 'onetone' ); ?></a></li>
                  <li><a href="<?php echo esc_url( 'http://www.mageewp.com/documents/faq/' ); ?>" target="_blank"><?php _e( 'FAQ', 'onetone' ); ?></a></li>
                  <li><a href="<?php echo esc_url( 'http://www.mageewp.com/knowledges/' ); ?>" target="_blank"><?php _e( 'Knowledge', 'onetone' ); ?></a></li>
                  <li><a href="<?php echo esc_url( 'http://www.mageewp.com/forums/onetone/' ); ?>" target="_blank"><?php _e( 'Support Forums', 'onetone' ); ?></a></li>
                  </ul>
      			
<?php
}


if ( ! function_exists( '_wp_render_title_tag' ) ) {
 function onetone_wp_title( $title, $sep ) {
	global $paged, $page;
	if ( is_feed() )
		return $title;

	// Add the site name.
	$title .= get_bloginfo( 'name' );

	// Add the site description for the home/front page.
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) )
		$title = "$title $sep $site_description";

	// Add a page number if necessary.
	if ( $paged >= 2 || $page >= 2 )
		$title = "$title $sep " . sprintf( __( ' Page %s ', 'onetone' ), max( $paged, $page ) );

	return $title;
}
add_filter( 'wp_title', 'onetone_wp_title', 10, 2 );
	}

if ( ! function_exists( '_wp_render_title_tag' ) ) {
	function onetone_slug_render_title() {
?>
<title><?php wp_title( '|', true, 'right' ); ?></title>
<?php
	}
	add_action( 'wp_head', 'onetone_slug_render_title' );
}

 
 /**
 * back to top
 */
 
function onetone_back_to_top(){
	
	$back_to_top_btn = onetone_option("back_to_top_btn");
	if( $back_to_top_btn != "hide" ){
    echo '<a href="javascript:;">
        	<div id="back-to-top">
        		<span class="fa fa-arrow-up"></span>
            	<span>'.__("TOP","onetone").'</span>
        	</div>
        </a>';
	}
        }
        
  add_action( 'wp_footer', 'onetone_back_to_top' );
  


// get social icon

function onetone_get_social( $position, $class = 'top-bar-sns',$placement='top',$target='_blank'){
	global $social_icons;
   $return = '';
   $rel    = '';
   
   $social_links_nofollow  = onetone_option( 'social_links_nofollow','no' ); 
   $social_new_window = onetone_option( 'social_new_window','yes' );  
   if( $social_new_window == 'no')
   $target = '_self';
   
   if( $social_links_nofollow == 'yes' )
   $rel    = 'nofollow';
   
   if(is_array($social_icons) && !empty($social_icons)):
   $return .= '<ul class="'.esc_attr($class).'">';
   $i = 1;
   foreach($social_icons as $sns_list_item){
	 
		 $icon = onetone_option( $position.'_social_icon_'.$i,'' );  
		 $title = onetone_option( $position.'_social_title_'.$i,'' );
		 $link = onetone_option( $position.'_social_link_'.$i,'' );  
	if(  $icon !="" ){
	 $return .= '<li><a target="'.esc_attr($target).'" rel="'.$rel.'" href="'.esc_url($link).'" data-placement="'.esc_attr($placement).'" data-toggle="tooltip" title="'.esc_attr( $title).'"><i class="fa fa-'.esc_attr( $icon).'"></i></a></li>';
	} 
	$i++;
	} 
	$return .= '</ul>';
	endif;
	return $return ;
	}
	
	
 // get top bar content

 function onetone_get_topbar_content( $type =''){

	 switch( $type ){
		 case "info":
		 echo '<div class="top-bar-info">';
		 echo onetone_option('top_bar_info_content');
		 echo '</div>';
		 break;
		 case "sns":
		 $tooltip_position = onetone_option('top_social_tooltip_position','bottom'); 
		 echo onetone_get_social('header','top-bar-sns',$tooltip_position);
		 break;
		 case "menu":
		 echo '<nav class="top-bar-menu">';
		 wp_nav_menu(array('theme_location'=>'top_bar_menu','depth'=>1,'fallback_cb' =>false,'container'=>'','container_class'=>'','menu_id'=>'','menu_class'=>'','link_before' => '<span>', 'link_after' => '</span>','items_wrap'=> '<ul id="%1$s" class="%2$s">%3$s</ul>'));
		 echo '</nav>';
		 break;
		 case "none":
		
		 break;
		 }
	 }
	 
/**
 * Convert Hex Code to RGB
 * @param  string $hex Color Hex Code
 * @return array       RGB values
 */
 
function onetone_hex2rgb( $hex ) {
		if ( strpos( $hex,'rgb' ) !== FALSE ) {

			$rgb_part = strstr( $hex, '(' );
			$rgb_part = trim($rgb_part, '(' );
			$rgb_part = rtrim($rgb_part, ')' );
			$rgb_part = explode( ',', $rgb_part );

			$rgb = array($rgb_part[0], $rgb_part[1], $rgb_part[2], $rgb_part[3]);

		} elseif( $hex == 'transparent' ) {
			$rgb = array( '255', '255', '255', '0' );
		} else {

			$hex = str_replace( '#', '', $hex );

			if( strlen( $hex ) == 3 ) {
				$r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) );
				$g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) );
				$b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) );
			} else {
				$r = hexdec( substr( $hex, 0, 2 ) );
				$g = hexdec( substr( $hex, 2, 2 ) );
				$b = hexdec( substr( $hex, 4, 2 ) );
			}
			$rgb = array( $r, $g, $b );
		}

		return $rgb; // returns an array with the rgb values
	}

/**
 * load less
 */
 

function onetone_enqueue_less_styles($tag, $handle) {
		global $wp_styles;
		$match_pattern = '/\.less$/U';
		if ( preg_match( $match_pattern, $wp_styles->registered[$handle]->src ) ) {
			$handle = $wp_styles->registered[$handle]->handle;
			$media = $wp_styles->registered[$handle]->args;
			$href = $wp_styles->registered[$handle]->src . '?ver=' . $wp_styles->registered[$handle]->ver;
			$rel = isset($wp_styles->registered[$handle]->extra['alt']) && $wp_styles->registered[$handle]->extra['alt'] ? 'alternate stylesheet' : 'stylesheet';
			$title = isset($wp_styles->registered[$handle]->extra['title']) ? "title='" . esc_attr( $wp_styles->registered[$handle]->extra['title'] ) . "'" : '';
	
			$tag = "<link rel='stylesheet' id='$handle' $title href='$href' type='text/less' media='$media' />\n";
		}
		return $tag;
	}
add_filter( 'style_loader_tag', 'onetone_enqueue_less_styles', 5, 2);


	 
	// get related posts
	
 function onetone_get_related_posts($post_id, $number_posts = -1,$post_type = 'post',$taxonomies='category') {
	//$query = new WP_Query();
	
	$categories = array();

	$terms = wp_get_object_terms( $post_id,  $taxonomies );
	  if ( ! empty( $terms ) ) {
		  if ( ! is_wp_error( $terms ) ) {
				  foreach( $terms as $term ) {
					  $categories[] = $term->term_id; 
				  }
		  }
	  }
   if( $post_type == 'post' )
    $args = array('category__in' => $categories);
	else
	$args = array('tax_query' => array(
        array(
            'taxonomy' => $taxonomies,
            'field'    => 'term_id',
            'terms'    => $categories,
        ),
    ),);
	
	if($number_posts == 0) {
		$query = new WP_Query();
		return $query;
	}

	$args = wp_parse_args($args, array(
		'posts_per_page' => $number_posts,
		'post__not_in' => array($post_id),
		'ignore_sticky_posts' => 0,
        'meta_key' => '_thumbnail_id',
		'post_type' =>$post_type,
		'operator'  => 'IN'
	));

	$query = new WP_Query($args);
    wp_reset_postdata(); 
  	return $query;
}



if ( ! function_exists( 'onetone_paging_nav' ) ) :
/**
 * Display navigation to next/previous set of posts when applicable.
 */
function onetone_paging_nav($echo='echo',$wp_query='') {
    if(!$wp_query){global $wp_query;}
    global $wp_rewrite;      
    $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;

	$pagination = array(
	'base' => @add_query_arg('paged','%#%'),
	'format'             => '?page=%#%',
	'total'              => $wp_query->max_num_pages,
	'current'            => $current,
	'show_all'           => false,
	'end_size'           => 1,
	'mid_size'           => 2,
	'prev_next'          => true,
	'prev_text'          => __(' Prev', 'onetone'),
	'next_text'          => __('Next ', 'onetone'),
	'type'               => 'list',
	'add_args'           => false,
	'add_fragment'       => '',
	'before_page_number' => '',
	'after_page_number'  => ''
);
 
    if( $wp_rewrite->using_permalinks() )
        $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg('s',get_pagenum_link(1) ) ) . 'page/%#%/', 'paged');
 
    if( !empty($wp_query->query_vars['s']) )
        $pagination['add_args'] = array('s'=>get_query_var('s'));
		
	if( $wp_query->max_num_pages > 1 ){
    if($echo == "echo"){
    echo '<nav class="post-list-pagination" role="navigation">
                                    <div class="post-pagination-decoration text-center">
                                    '.paginate_links($pagination).'</div></nav>'; 
	}else
	{
	
	return '<nav class="post-list-pagination" role="navigation">
                                    <div class="post-pagination-decoration text-center">'.paginate_links($pagination).'</div></nav>';
	}
	
	}
}
endif;

/**
 * Display navigation to next/previous post when applicable.
 */
 
if ( ! function_exists( 'onetone_post_nav' ) ) :

function onetone_post_nav() {
	// Don't print empty markup if there's nowhere to navigate.
	$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
	$next     = get_adjacent_post( false, '', false );

	if ( ! $next && ! $previous ) {
		return;
	}
	?>
    <nav class="post-pagination" role="navigation">
                                        <ul class="clearfix">
                                        <?php
											previous_post_link( '<li class="pull-left">%link</li>', '%title' );
											next_post_link(     '<li class="pull-right">%link</li>', '%title' );
										?>
                                        </ul>
                                    </nav>  
                                    
	<!-- .navigation -->
	<?php
}
endif;

 // get post content css class
 function onetone_get_content_class( $sidebar = '' ){
	 
	 if( $sidebar == 'left' )
	 return 'left-aside';
	 if( $sidebar == 'right' )
	 return 'right-aside';
	 if( $sidebar == 'both' )
	 return 'both-aside';
	  if( $sidebar == 'none' )
	 return 'no-aside';
	 
	 return 'no-aside';
	 
	 }

// remove woocommerce page title

function onetone_woocommerce_show_page_title(){
	return false;
	}
add_filter('woocommerce_show_page_title','onetone_woocommerce_show_page_title');

// fix shortcode

 function onetone_fix_shortcodes($content){   
			$replace_tags_from_to = array (
				'<p>[' => '[', 
				']</p>' => ']', 
				']<br />' => ']',
				']<br>' => ']',
				']\r\n' => ']',
				']\n' => ']',
				']\r' => ']',
				'\r\n[' => '[',
			);

			return strtr( $content, $replace_tags_from_to );
		}

 function onetone_the_content_filter($content) {
	  $content = onetone_fix_shortcodes($content);
	  return $content;
	}
	
add_filter( 'the_content', 'onetone_the_content_filter' );


// cover excerpt length
 function onetone_get_excerpt($count,$postid){
  $permalink = get_permalink($postid);
  $excerpt = get_the_content();
  $excerpt = strip_tags($excerpt);
  $excerpt = substr($excerpt, 0, $count);
  $excerpt = substr($excerpt, 0, strripos($excerpt, " "));
  $excerpt = $excerpt.'[...]';
  return $excerpt;
}

// cover content length
 function onetone_cover_content($count,$content){
  $content = substr($content, 0, $count);
  $content = substr($content, 0, strripos($content, " "));
  $content = $content.'[...]';
  return $content;
}


function onetone_tinymce_config( $init ) {


	// IFRAME
	$valid_iframe = 'iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width],span[class|id|title|style],a[href],ul[id|class|style],br,p';

	// Add to extended_valid_elements if it alreay exists
	if ( isset( $init['extended_valid_elements'] ) ) {
		$init['extended_valid_elements'] .= ',' . $valid_iframe;
	} else {
		$init['extended_valid_elements'] = $valid_iframe;
	}

// Pass $init back to WordPress
	return $init;
}
//add_filter('tiny_mce_before_init', 'onetone_tinymce_config');


// ################################## fonts family
   /**
 * Returns an array of system fonts
 */
 
function onetone_options_typography_get_os_fonts() {
    // OS Font Defaults
    $os_faces = array(
            'Arial, sans-serif' => 'Arial',
	     //   '"Avant Garde", sans-serif' => 'Avant Garde',
	        'Cambria, Georgia, serif' => 'Cambria',
			'Calibri,sans-serif' => 'Calibri' ,
	        'Copse, sans-serif' => 'Copse',
	        'Garamond, "Hoefler Text", Times New Roman, Times, serif' => 'Garamond',
	        'Georgia, serif' => 'Georgia',
	        '"Helvetica Neue", Helvetica, sans-serif' => 'Helvetica Neue',
	        'Tahoma, Geneva, sans-serif' => 'Tahoma'
	    );
	    return $os_faces;
	}
	
	
	/**
 * Returns a select list of Google fonts
 * Feel free to edit this, update the fallbacks, etc.
 */
 
function onetone_options_typography_get_google_fonts() {
    // Google Font Defaults
	
	global $google_fonts_json;
	
	$googleFontArray = array();

   $fontArray = json_decode($google_fonts_json, true);
   
   foreach($fontArray['items'] as $index => $value){
	   
   $_family = strtolower( str_replace(' ','_',$value['family']) );
   $googleFontArray[$_family]['family'] = $value['family'];
   $googleFontArray[$_family]['variants'] = $value['variants'];
   $googleFontArray[$_family]['subsets'] = $value['subsets'];
 
   $category = '';
   if( isset($value['category']) ) $category = ', '.$value['category'];
   $googleFontArray['onetone_of_family'][$value['family'].$category] = $value['family'];
   
   }
   	    return $googleFontArray;
	}
	
/*
*  get typography
*
*/

	
function onetone_options_typography_enqueue_google_font($font) {
	
	   $googleFontArray       = onetone_options_typography_get_google_fonts() ;
	   $googleFontFamilyArray = array() ;
	   foreach($googleFontArray['onetone_of_family'] as $k => $v){
		   $googleFontFamilyArray[] = $k;
		   }
	   if( in_array( $font , $googleFontFamilyArray ) ){
	    $font = explode(',', $font);
	    $font = $font[0];
		$_font_add_string = '';
		$_family = strtolower( str_replace(' ','_',$font) );
		
		if(count( $googleFontArray[$_family]['variants'] )) $_font_add_string = ":". implode(',', $googleFontArray[$_family]['variants']);
		
	    $font = str_replace(" ", "+", $font);
	    wp_enqueue_style( "onetone-typography-$_family", esc_url("//fonts.googleapis.com/css?family=$font" . $_font_add_string), false, null, 'all' );
	   }
		
}


 function onetone_get_typography( $option= array() ){


	 $return = "";
	 if( $option && is_array($option) ){
	 if($option['face']){
	 $return .= 'font-family:'.$option['face'].';' ;
	 onetone_options_typography_enqueue_google_font($option['face']);
	 }
	
	 if(isset($option['size']) && !is_array($option['size']) )
	 $return .= 'font-size:'.$option['size'].';' ;
	 if($option['style'])
	 $return .= 'font-weight:'.$option['style'].';' ;
	 if($option['color'])
	 $return .= 'color:'.$option['color'].';' ;
		 }
		 
	return $return ;
	 
	 }
	 


function onetone_of_recognized_font_styles() {
	$default = array(
	'normal' => 'normal',
	'italic' =>  'italic',
	'bold' =>  'bold',
	'bold italic' =>  'bold italic',
	'100' =>  '100',
	'200' =>  '200',
	'300' =>  '300',
	'400' =>  '400',
	'500' =>  '500',
	'600' =>  '600',
	'700' =>  '700',
	'800' =>  '800',
	'900' =>  '900'
  );
	return apply_filters( 'onetone_of_recognized_font_styles', $default );
}
add_filter( 'of_recognized_font_styles', 'onetone_of_recognized_font_styles' );
//###################################



function onetone_admin_notice(){
    if ( class_exists('Magee_Core') ) {
        echo '<div class="updated"><p>Once you got onetone theme updated from free to pro, do make sure that you got the <strong>Magee Shortcodes</strong> (the free version) deactivated in "plugin/installed plugins". Since Onetone pro was built in with <strong>Magee Shortcodes</strong> pro, no need for the free version anymore.
</p></div>';
    }
}

//add_action('admin_notices', 'onetone_admin_notice');


// footer tracking code
	
 function onetone_tracking_code(){
   $tracking_code = onetone_option('tracking_code');
   echo $tracking_code;
 } 

add_action('wp_footer', 'onetone_tracking_code'); 

 // Space before </head>
	
 function onetone_space_before_head(){
   $space_before_head = onetone_option('space_before_head');
   echo $space_before_head;
 } 

add_action('wp_head', 'onetone_space_before_head'); 


 // Space before </body>
	
 function onetone_space_before_body(){
   $space_before_body = onetone_option('space_before_body');
   echo $space_before_body;
 } 

add_action('wp_footer', 'onetone_space_before_body'); 

add_action('init', 'onetone_html_tags_code', 10);
function onetone_html_tags_code() {
  global $allowedposttags;

    $allowedposttags["javascript"] = array("src" => array(),"type" => array());
    $allowedposttags["style"] = array("type" => array());
	$allowedposttags["link"] = array("rel" => array(),"href" => array(),"id" => array(),"type" => array(),"media" => array());

}



// get summary

 function onetone_get_summary(){
	 
	 $excerpt_or_content        = onetone_option('excerpt_or_content','excerpt');
	 $excerpt_length            = onetone_option('excerpt_length','55');
	 if( $excerpt_or_content == 'full_content' ){
	 $output = get_the_content();
	 }
	 else{
	 $output = get_the_excerpt();
	 if( is_numeric($excerpt_length) && $excerpt_length !=0  )
	 $output = onetone_content_length($output, $excerpt_length );
	 }
	 return  $output;
	 }
	 
 function onetone_content_length($content, $limit) {
    $excerpt = explode(' ', get_the_excerpt(), $limit);
    if (count($excerpt)>=$limit) {
        array_pop($excerpt);
        $excerpt = implode(" ",$excerpt).'...';
      } else {
        $excerpt = implode(" ",$excerpt);
      } 
    $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
    return $excerpt;
    }
	
	
if ( ! function_exists( 'onetone_posted_on' ) ) :
/**
 * Prints HTML with meta information for the current post-date/time and author.
 */
function onetone_posted_on() {
	$return = '';
	$display_post_meta = onetone_option('display_post_meta','yes');
		
	if( $display_post_meta == 'yes' ){
		
	  $display_meta_author     = onetone_option('display_meta_author','yes');
	  $display_meta_date       = onetone_option('display_meta_date','yes');
	  $display_meta_categories = onetone_option('display_meta_categories','yes');
	  $display_meta_comments   = onetone_option('display_meta_comments','yes');
	  $display_meta_readmore   = onetone_option('display_meta_readmore','yes');
	  $display_meta_tags       = onetone_option('display_meta_tags','yes');
	  $date_format             = onetone_option('date_format','M d, Y');
	
		
	   $return .=  '<ul class="entry-meta">';
	  if( $display_meta_date == 'yes' )
		$return .=  '<li class="entry-date"><i class="fa fa-calendar"></i>'. get_the_date( $date_format ).'</li>';
	  if( $display_meta_author == 'yes' )
		$return .=  '<li class="entry-author"><i class="fa fa-user"></i>'.get_the_author_link().'</li>';
	  if( $display_meta_categories == 'yes' )		
		$return .=  '<li class="entry-catagory"><i class="fa fa-file-o"></i>'.get_the_category_list(', ').'</li>';
	  if( $display_meta_comments == 'yes' )	
		$return .=  '<li class="entry-comments pull-right">'.onetone_get_comments_popup_link('', __( '<i class="fa fa-comment"></i> 1 ', 'onetone'), __( '<i class="fa fa-comment"></i> % ', 'onetone'), 'read-comments', '').'</li>';
        $return .=  '</ul>';
	}

	echo $return;

}
endif;


/**
 * Modifies WordPress's built-in comments_popup_link() function to return a string instead of echo comment results
 */
function onetone_get_comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {
    global $wpcommentspopupfile, $wpcommentsjavascript;
 
    $id = get_the_ID();
 
    if ( false === $zero ) $zero = __( 'No Comments', 'onetone');
    if ( false === $one ) $one = __( '1 Comment', 'onetone');
    if ( false === $more ) $more = __( '% Comments', 'onetone');
    if ( false === $none ) $none = __( 'Comments Off', 'onetone');
 
    $number = get_comments_number( $id );
    $str = '';
 
    if ( 0 == $number && !comments_open() && !pings_open() ) {
        $str = '<span' . ((!empty($css_class)) ? ' class="' . esc_attr( $css_class ) . '"' : '') . '>' . $none . '</span>';
        return $str;
    }
 
    if ( post_password_required() ) {
     
        return '';
    }
	
 
    $str = '<a href="';
    if ( $wpcommentsjavascript ) {
        if ( empty( $wpcommentspopupfile ) )
            $home = home_url();
        else
            $home = get_option('siteurl');
        $str .= $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id;
        $str .= '" onclick="wpopen(this.href); return false"';
    } else { // if comments_popup_script() is not in the template, display simple comment link
        if ( 0 == $number )
            $str .= get_permalink() . '#respond';
        else
            $str .= get_comments_link();
        $str .= '"';
    }
 
    if ( !empty( $css_class ) ) {
        $str .= ' class="'.$css_class.'" ';
    }
    $title = the_title_attribute( array('echo' => 0 ) );
 
    $str .= apply_filters( 'comments_popup_link_attributes', '' );
 
    $str .= ' title="' . esc_attr( sprintf( __('Comment on %s', 'onetone'), $title ) ) . '">';
    $str .= onetone_get_comments_number_str( $zero, $one, $more );
    $str .= '</a>';
     
    return $str;
}

/**
 * Modifies WordPress's built-in comments_number() function to return string instead of echo
 */
function onetone_get_comments_number_str( $zero = false, $one = false, $more = false, $deprecated = '' ) {
    if ( !empty( $deprecated ) )
        _deprecated_argument( __FUNCTION__, '1.3' );
 
    $number = get_comments_number();
 
    if ( $number > 1 )
        $output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments', 'onetone') : $more);
    elseif ( $number == 0 )
        $output = ( false === $zero ) ? __('No Comments', 'onetone') : $zero;
    else // must be one
        $output = ( false === $one ) ? __('1 Comment', 'onetone') : $one;
 
    return apply_filters('comments_number', $output, $number);
}



function onetone_array_sort($array,$keys,$type='asc'){
	  if(!isset($array) || !is_array($array) || empty($array)){
	  return '';
	  }
	  if(!isset($keys) || trim($keys)==''){
	  return '';
	  }
	  if(!isset($type) || $type=='' || !in_array(strtolower($type),array('asc','desc'))){
	  return '';
	  }
	  $keysvalue=array();
	  foreach($array as $key=>$val){
	  $val[$keys] = str_replace('-','',$val[$keys]);
	  $val[$keys] = str_replace(' ','',$val[$keys]);
	  $val[$keys] = str_replace(':','',$val[$keys]);
	  $keysvalue[] =$val[$keys];
	  }
	  asort($keysvalue); 
	  reset($keysvalue); 
	  foreach($keysvalue as $key=>$vals) {
	  $keysort[] = $key;
	  }
	  $keysvalue = array();
	  $count=count($keysort);
	  if(strtolower($type) != 'asc'){
	  for($i=$count-1; $i>=0; $i--) {
	  $keysvalue[] = $array[$keysort[$i]];
	  }
	  }else{
	  for($i=0; $i<$count; $i++){
		  if(isset($array[$keysort[$i]]))
	  $keysvalue[] = $array[$keysort[$i]];
	  }
	  }
	  return $keysvalue;
}

/**
 * Change the Shop archive page title.
 * @param  string $title
 * @return string
 */
 
function onetone_custom_shop_archive_title( $title ) {
    if ( function_exists('is_shop') && function_exists('woocommerce_page_title') &&  is_shop() ) {
        return str_replace( __( 'Products', 'onetone' ), woocommerce_page_title(false), $title );
    }
    return $title;
}
add_filter( 'wp_title', 'onetone_custom_shop_archive_title' );

function onetone_is_plugin_active( $plugin ) {
    return in_array( $plugin, (array) get_option( 'active_plugins', array() ) );
}



// Onetone guide tips

/* $option_name  = optionsframework_option_name();
 $options_saved = false;
	if ( get_option($option_name) ) {
		$options_saved = true;
	}
if( (!isset($_GET['page']) || ($_GET['page'] !='onetone-options' && $_GET['page'] !='import-demos' && $_GET['page'] !='onetone' ) ) && $options_saved == false )
add_action('admin_menu', 'onetone_guide_submenu_page');

function onetone_guide_submenu_page() {
	
	// add_theme_page(__('Import Onetone Demos', 'onetone' ),__('Import Onetone Demos', 'onetone' ), 'edit_theme_options', 'import-demos', 'onetone_import_demos');
	 
	add_theme_page( __('Onetone step 2', 'onetone' ),  '<div class="onetone-step-2-text"><h2>'.__('Customize Content for Homepage', 'onetone' ).'</h2>
<p>'.__('Open this page to edit content for homepage and customize styles of the site.', 'onetone' ).'</p><div id="onetone-step-1-text" style=" display:none;"><div class="onetone-step-1"><div class="onetone-step-1-text"><h2>'.__('Customize Content for Homepage', 'onetone' ).'</h2><p>'.__('Open this page to edit content for homepage and customize styles of the site.', 'onetone' ).'</p></div></div></div></div>', 'edit_theme_options', 'themes.php?page=onetone-options', '' );
}
*/
if( isset($_GET['page']) && $_GET['page'] =='onetone-options' )
add_action('admin_footer', 'onetone_admin_footer_function');

function onetone_admin_footer_function() {
	echo '<div class="onetone-admin-footer" style="height: 60px; display:none;background: rgba(0,0,0,0.5); position:fixed;bottom:0px;padding:15px 0;z-index:99;cursor: pointer;width: 100%;"><span style=" margin-left:180px; font-size:16px;color:#fff;">'.__('To save any changes on onetone options, click on the <strong  style="color:orange;">Save All Options</strong> button on the right side.', 'onetone' ).'</span><button class="button-primary" id="onetone-save-options" style=" float:right;margin-right:50px;">'.__('Save All Options', 'onetone' ).'</button></div>
	<div class="options-saved"><i class="fa fa-check"></i>'.__('Options Updated', 'onetone' ).'</div>
	<div class="options-saving"><i class="fa fa-spinner fa-spin"></i>'.__('Options Saving', 'onetone' ).'</div>
	';
}


function onetone_tinymce_init() {
    // Hook to tinymce plugins filter
    add_filter( 'mce_external_plugins', 'onetone_tinymce_plugin' );
}
add_filter('init', 'onetone_tinymce_init');

function onetone_tinymce_plugin($init) {
    // We create a new plugin... linked to a js file.
    // Mine was created from a plugin... but you can change this to link to a file in your plugin
    $init['keyup_event'] = get_template_directory_uri() . '/js/keyup_event.js';
    return $init;
}


add_filter( 'wp_kses_allowed_html', 'onetone_allowedposttags_filter',1,1 );

function onetone_allowedposttags_filter( $allowedposttags ) {

 $allowedposttags['i'] = array ( 'class' => 1,'style' => 1);
 $allowedposttags['input']  = array ( 'class' => 1, 'id'=> 1, 'style' => 1, 'type' => 1, 'name'=>1,'value' => 1 ,'placeholder'=> 1,'size'=> 1,'tabindex'=> 1,'aria-required'=> 1);
 $allowedposttags['iframe'] = array(
					'align' => true,
					'width' => true,
					'height' => true,
					'frameborder' => true,
					'name' => true,
					'src' => true,
					'id' => true,
					'class' => true,
					'style' => true,
					'scrolling' => true,
					'marginwidth' => true,
					'marginheight' => true,
					
  );
	  return $allowedposttags;

}
<file_sep>/js/keyup_event.js
jQuery(document).ready(function($) {

    // Create 'keyup_event' tinymce plugin
    tinymce.PluginManager.add('keyup_event', function(editor, url) {

        // Create keyup event
        editor.on('keyup', function(e) {

            // Get the editor content (html)
            get_ed_content = tinymce.activeEditor.getContent();
			id             = $(this).attr('id');
            // Do stuff here... (run do_stuff_here() function)
            do_stuff_here(id,get_ed_content);
		
        });
    });
    // This function allows the script to run from both locations (visual and text)
    function do_stuff_here(id,content) {

        // Now, you can further process the data in a single function
        $('#'+id).val(content);
    }
});<file_sep>/pageprofileempresa.php
<?php /* Template Name: Empresa Template Profile */

  get_header('pagedefault');

?>
  <link href='http://fonts.googleapis.com/css?family=Droid+Serif|Open+Sans:400,700' rel='stylesheet' type='text/css'>

  <?php 
    echo '<link rel="stylesheet" href="'.get_template_directory_uri().'/css/vertical-timeline-style.css">';
    echo '<script src="'.get_template_directory_uri().'/js/vertical-timeline-modernizr.js"></script>';
    ?>
<script type="text/javascript">
  jQuery(document).ready(function () {

    jQuery('#anchor_empresa').addClass('active');
    jQuery('.expanded-view').hide();

    jQuery('.interstitial').click(function (){
      if (jQuery(this).hasClass('col-lg-6')) {
        jQuery('.interstitial').addClass('col-lg-3');
        jQuery('.interstitial').removeClass('col-lg-2');
        jQuery('.interstitial').removeClass('col-lg-6');
        jQuery('.expanded-view').hide();
        jQuery(this).children('.chopped-view').show();
      }else{
        jQuery('.expanded-view').find('.text-overlay').hide();
        jQuery('.interstitial').addClass('col-lg-2');
        jQuery('.interstitial').removeClass('col-lg-3');
        jQuery('.interstitial').removeClass('col-lg-6');
        jQuery(this).addClass('col-lg-6');
        jQuery(this).removeClass('col-lg-2');
        jQuery('.chopped-view').show();
        jQuery('.expanded-view').hide();
        jQuery(this).children('.chopped-view').hide();
        jQuery(this).children('.expanded-view').show('100',function (){
          jQuery(this).find('.text-overlay').fadeIn( "slow");
        });
      }

    });
  });

</script>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

  <div class="entry-content">
    <?php $url = wp_get_attachment_url(get_post_thumbnail_id(get_the_ID ()));
        $bkg = ($url) ? 'style="background-image:url('.$url.')"' : '';
    ?>

    <div class="header-page header-empresa" <?=$bkg?>>
      <div><h1><?php echo the_title();?></h1></div>
    </div>

    <?php $post = get_post();
      echo $post->post_content;
    ?>

     </div>
      <div class="container">
        <div class="row">
        <div class="col-md-12">
            <section class="cd-horizontal-timeline">
              <div class="timeline">
                <div class="events-wrapper">
                  <div class="events">
                    <ol>
                      <?php //obtencion del history
                        query_posts(array(
                        'post_type' => 'histories',
                        'order'=>'ASC',
                        'orderby'=> 'title',
                        'posts_per_page' => -1
                        ));

                        $i=0;
                        $content='';
                        while (have_posts()) {
                          the_post();
                          $title = get_the_title();
                          $i++;
                          $clase = ($i == 1) ? 'class="selected"' : '';
                          echo '<li><a href="#0" data-date="'.$title.'" '.$clase.'>'.substr($title, -4).'</a></li>';

                          $content.= '<li '.$clase.' data-date="'.$title.'">'.get_the_content().'</li>';
                        }
                      ?>

                    </ol>

                    <span class="filling-line" aria-hidden="true"></span>
                  </div> <!-- .events -->
                </div> <!-- .events-wrapper -->

                <ul class="cd-timeline-navigation">
                  <li><a href="#0" class="prev inactive">Prev</a></li>
                  <li><a href="#0" class="next">Next</a></li>
                </ul> <!-- .cd-timeline-navigation -->
              </div> <!-- .timeline -->

              <div class="events-content">
                <ol>
                  <?=$content;?>
                </ol>
              </div> <!-- .events-content -->
            </section>

          <?php //obtencion del history
                                  query_posts(array(
                                  'post_type' => 'histories',
                                  'order'=>'ASC',
                                  'orderby'=> 'title',
                                  'posts_per_page' => -1
                                  ));

                                  $i=0;
                                  $content_2='';
                                  while (have_posts()) {
                                    the_post();
                                    $title = get_the_title();
                                    $i++;
                                    

                                    $content_2.= '    <div class="cd-timeline-vertical-block">


                <div class="cd-timeline-vertical-content">
                  <h3>'.substr($title, -4).'</h3>
                  <p>'.get_the_content().'</p>
                  
                </div> <!-- cd-timeline-content -->
              </div> <!-- cd-timeline-vertical-block -->';
                                  }
                      ?>

<section id="cd-timeline-responsive" class="cd-container">
    <?=$content_2;?>
  </section> <!-- cd-timeline -->
        </div>
        </div>
      </div>
  </article>
    <?php
      echo '<script type="text/javascript" src="'.get_template_directory_uri().'/js/timeline.js"></script>';
      echo '<script src="'.get_template_directory_uri().'/js/vertical-timeline-main.js"></script>';

      get_footer();
    ?><file_sep>/pageprofilejobs.php
<?php /* Template Name: Profile: Jobs Template */

get_header(); 
global $page_meta;
$detect  = new Mobile_Detect;
$enable_page_title_bar     = onetone_option('enable_page_title_bar');
$page_title_bg_parallax    = esc_attr(onetone_option('page_title_bg_parallax','no'));
$page_title_bg_parallax    = $page_title_bg_parallax=="yes"?"parallax-scrolling":"";
$display_breadcrumb        = esc_attr(onetone_option('display_breadcrumb','yes'));
$breadcrumbs_on_mobile     = esc_attr(onetone_option('breadcrumbs_on_mobile_devices','yes'));
$breadcrumb_menu_prefix    = esc_attr(onetone_option('breadcrumb_menu_prefix',''));
$breadcrumb_menu_separator = esc_attr(onetone_option('breadcrumb_menu_separator','/'));

$sidebar                   = isset($page_meta['page_layout'])?$page_meta['page_layout']:'none';
$left_sidebar              = isset($page_meta['left_sidebar'])?$page_meta['left_sidebar']:'';
$right_sidebar             = isset($page_meta['right_sidebar'])?$page_meta['right_sidebar']:'';
$full_width                = isset($page_meta['full_width'])?$page_meta['full_width']:'no';
$display_breadcrumb        = isset($page_meta['display_breadcrumb'])?$page_meta['display_breadcrumb']:$display_breadcrumb;
$display_title             = isset($page_meta['display_title'])?$page_meta['display_title']:'yes';
$padding_top               = isset($page_meta['padding_top'])?$page_meta['padding_top']:'';
$padding_bottom            = isset($page_meta['padding_bottom'])?$page_meta['padding_bottom']:'';

$enable_page_title_bar     = (isset($page_meta['display_title_bar']) && $page_meta['display_title_bar']!='')?$page_meta['display_title_bar']:$enable_page_title_bar;

if( $full_width  == 'no' )
 $container = 'container';
else
 $container = 'container-fullwidth';
 
$aside          = 'no-aside';
if( $sidebar =='left' )
$aside          = 'left-aside';
if( $sidebar =='right' )
$aside          = 'right-aside';
if(  $sidebar =='both' )
$aside          = 'both-aside';

$container_css = '';
if( $padding_top )
$container_css .= 'padding-top:'.$padding_top.';';
if( $padding_bottom )
$container_css .= 'padding-bottom:'.$padding_bottom.';';

?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> role="article">
    <?php if (  has_post_thumbnail() ): ?>
    <div class="feature-img-box">
      <div class="img-box">
        <?php the_post_thumbnail();?>
      </div>
    </div>
    <?php endif;?>

<?php if( $enable_page_title_bar == 'yes' ):?>
  
  <section class="page-title-bar title-left no-subtitle" style="">
    <div class="container">
      <div class="page-title">
        <h1 class="text-center"><?php the_title();?></h1>
      </div>
      <?php if( $display_breadcrumb == 'yes' && !$detect->isMobile() ):?>
      <?php onetone_get_breadcrumb(array("before"=>"<div class=''>".$breadcrumb_menu_prefix,"after"=>"</div>","show_browse"=>false,"separator"=>$breadcrumb_menu_separator,'container'=>'div'));?>
       <?php endif;?>
       
       <?php if( $breadcrumbs_on_mobile == 'yes' && $detect->isMobile()):?>
      <?php onetone_get_breadcrumb(array("before"=>"<div class=''>".$breadcrumb_menu_prefix,"after"=>"</div>","show_browse"=>false,"separator"=>$breadcrumb_menu_separator,'container'=>'div'));?>
       <?php endif;?>
       
      <div class="clearfix"></div>
    </div>
  </section>
 
  <?php endif;?>
  <div class="post-wrap">
    <div class="<?php echo $container;?>">
      <div class="post-inner row <?php echo $aside; ?>" style=" <?php echo $container_css;?>">
        <div class="col-main">
          <section class="post-main" role="main" id="content">
            <?php while ( have_posts() ) : the_post(); ?>
            <article class="post type-post" id="" role="article">
              <div class="entry-main">
            
                <div class="entry-content">
                  <?php the_content();?>
                  <?php
                    wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'onetone' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) );
                  ?>
                  
                  <section class="job-container pvm">
                  	<div class="container">
                  		<h1 class="content-title"><?php _e("[:es]Ofertas de trabajo[:en]Job offers"); ?></h1>
                  		<div class="row mbs">
	                  		<h2 class="title-tagline col-sm-6 col-xs-12"><?php _e("[:es]Éstas son nuestras vacantes actuales[:en]These are our current vacancies."); ?></h2>                 		

							<div id="location-job-filter" class="input-group pull-right">
							    <div class="input-group-addon"><i class="fa fa-map-marker"></i></div>
								<select class="form-control">
									<option value="">Filtra por localización</option>
									<option value="barcelona">Barcelona</option>
									<option value="madrid">Madrid</option>
									<option value="sevilla">Sevilla</option>
								</select>
							</div>
						</div>

                    <?php
                      function CallAPI($url) {
                          $curl = curl_init();

                          $client_id = 'ead3a0c7c59f4d1d81143fa9d2277147';
                          $client_secret = '<KEY>';

                          curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
                          curl_setopt($curl, CURLOPT_USERPWD, $client_id . ':' . $client_secret);
                          curl_setopt($curl, CURLOPT_URL, $url);
                          curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

                          $result = curl_exec($curl);
                          curl_close($curl);

                          return $result;
                      }
                  
                      $array = json_decode(CallAPI('https://api.infojobs.net/api/1/offer?employerId=9664852452652250253012575553'))->offers;
                      //print_r($array);
                      //print_r($array[0]);
                  
                      $urls = array();
                      for($i=0; $i<count($array); $i++){   
                          array_push($urls, 'https://api.infojobs.net/api/1/offer/' . $array[$i]->id);
                      }
                  
                      $url_count = count($urls);
                      $curl_array = array();
                      $ch = curl_multi_init();

                      foreach($urls as $count => $url) {
                          $curl_array[$count] = curl_init($url);
                          $client_id = 'ead3a0c7c59f4d1d81143fa9d2277147';
                          $client_secret = '<KEY>';
                          curl_setopt($curl_array[$count], CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
                          curl_setopt($curl_array[$count], CURLOPT_USERPWD, $client_id . ':' . $client_secret);
                          curl_setopt($curl_array[$count], CURLOPT_RETURNTRANSFER, 1);
                          curl_multi_add_handle($ch, $curl_array[$count]);
                      }
                  
                      do {
                        curl_multi_exec($ch, $exec);
                      } while($exec > 0);
                     

                      /* Dynamic select with job´s provinces
                      echo '<select class="country">
							<option value="">Filtra por porvincia</option>';
							foreach($urls as $count => $url) {
                          		$returned = json_decode(curl_multi_getcontent($curl_array[$count]));

								$provinceArray = array();
								$provinceValue = $returned->province->value;
								if (isset($provinceArray[$provinceValue])) {echo $provinceValue;
								} else {
								echo '<option value="'.strtolower($returned->province->value).'">'.$returned->province->value.'</option>';
								};
							}
						echo '</select>';
						*/

                      echo '<div class="offers-list grid-divider">';
                      foreach($urls as $count => $url) {
                          if( $count % 2 == 0) {
                          	$jobPos = 'item-left';
                          } else {
                          	$jobPos = 'item-right';                          	
                          }
                          $returned = json_decode(curl_multi_getcontent($curl_array[$count]));
                          echo '<a href="' . $returned->link . '" target="_blank" id="job-offer-'.$count.'" class="job-item col-sm-6 col-xs-12 ' . strtolower($returned->province->value) .' '.$jobPos.'">
                          		<div class="col-padding">
                                <div class="job-location"><i class="fa fa-map-marker"></i>' . $returned->city . ' (' . $returned->province->value . ')</div>
                                <h3>' . $returned->title  . '</h3>
                                <span class="job-extra"> Jornada ' . $returned->journey->value;

                          if ($returned->contractType->value == "(Seleccionar)") { //SI no ha sido definidio tipo en infojobs
                             echo '</span>';
                          }
                          else{
                            echo ' / Contrato ' . $returned->contractType->value . '</span>';
                          }
                          echo '<p class="job-description">' . preg_replace('/[\x00-\x08\x10\x0B\x0C\x0E-\x19\x7F]'.
                                '|[\x00-\x7F][\x80-\xBF]+'.
                                '|([\xC0\xC1]|[\xF0-\xFF])[\x80-\xBF]*'.
                                '|[\xC2-\xDF]((?![\x80-\xBF])|[\x80-\xBF]{2,})'.
                                '|[\xE0-\xEF](([\x80-\xBF](?![\x80-\xBF]))|(?![\x80-\xBF]{2})|[\x80-\xBF]{3,})/S',
                                '?', substr($returned->description, 0, 155)) . '...</p>'.
                          		'<span class="btn btn-ghost">';
                          		_e('[:es]Más información[:en]More info');
                          		echo '</span>';
                          echo '</div>';
                          echo '</a>';
                          if( ($count+1) % 2 == 0) {
                          	echo '<p class="clear"></p>';
                          }
                      }

                      echo '</div>';
                    ?>
                    </div>
                    </section>

                    <section id="job-form" class="bg-light-grey pvm brd2">
	                    <div class="container">
	                      <?php echo do_shortcode('[contact-form-7 id="203" title="Job form general"]') ?>
	                    </div>
                    </section>
                  </div>
                </div>                
              </div>
            </article>

            <div class="post-attributes">
              <!--Comments Area-->
              <div class="comments-area text-left">
                <?php
            // If comments are open or we have at least one comment, load up the comment template
            if ( comments_open()  ) :
              comments_template();
            endif;
          ?>
              </div>
              <!--Comments End-->
            </div>
            <?php endwhile; // end of the loop. ?>
          </section>
        </div>


      </div>
    </div>
  </div>
</article>

<?php get_footer(); ?><file_sep>/lib/importer/importer.php
<?php
defined( 'ABSPATH' ) or die( 'You cannot access this script directly' );

// Don't resize images
function onetone_filter_image_sizes( $sizes ) {
	return array();
}

// Hook importer into admin init
add_action( 'wp_ajax_magee_import_demo_data', 'magee_importer' );
function magee_importer() {
	global $wpdb;
    
	if ( current_user_can( 'manage_options' ) ) {
		if ( !defined('WP_LOAD_IMPORTERS') ) define('WP_LOAD_IMPORTERS', true); // we are loading importers

		if ( ! class_exists( 'WP_Importer' ) ) { // if main importer class doesn't exist
			$wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
			include $wp_importer;
		}

		if ( ! class_exists('WP_Import') ) { // if WP importer doesn't exist
			$wp_import = get_template_directory() . '/lib/importer/wordpress-importer.php';
			include $wp_import;
		}

		if ( class_exists( 'WP_Importer' ) && class_exists( 'WP_Import' ) ) { // check for main import class and wp import class
			if( ! isset($_POST['demo_type']) || trim($_POST['demo_type']) == '' ) {
				$demo_type = 'classic';
			} else {
				$demo_type = $_POST['demo_type'];
			}

			switch($demo_type) {
				
				case 'resume':
					$shop_demo = false;
					$woo_xml   = get_template_directory() . '/lib/importer/demos/resume/onetone-pro-resume.xml';
					$theme_xml_file = get_template_directory() . '/lib/importer/demos/resume/onetone-pro-resume.xml';
					$theme_options_file = get_template_directory() . '/lib/importer/demos/resume/theme_options_resume.txt';


					// Sidebar Widgets File
					$widgets_file = get_template_directory() . '/lib/importer/demos/resume/widget_data_resume.json';

					$layerslider_exists = false;
					$layer_directory = get_template_directory() . '/lib/importer/demos/resume/layersliders/';

					$revslider_exists = false;
					$rev_directory = get_template_directory() . '/lib/importer/demos/resume/revsliders/';

					// reading settings
					$homepage_title = 'Homepage';
					$posts_page_title='Blog';
			 break;
			 
			 case 'app':				
					$shop_demo = false;
					$woo_xml   = get_template_directory() . '/lib/importer/demos/app/onetone-pro-app.xml';
					$theme_xml_file = get_template_directory() . '/lib/importer/demos/app/onetone-pro-app.xml';
					$theme_options_file = get_template_directory() . '/lib/importer/demos/app/theme_options_app.txt';


					// Sidebar Widgets File
					$widgets_file = get_template_directory() . '/lib/importer/demos/app/widget_data_app.json';

					$layerslider_exists = false;
					$layer_directory = get_template_directory() . '/lib/importer/demos/app/layersliders/';

					$revslider_exists = false;
					$rev_directory = get_template_directory() . '/lib/importer/demos/app/revsliders/';

					// reading settings
					$homepage_title = 'Homepage';
					$posts_page_title='Blog';
			 break;
			 
			 case 'fashion':
					$shop_demo = false;
					$woo_xml   = get_template_directory() . '/lib/importer/demos/fashion/onetone-pro-fashion.xml';
					$theme_xml_file = get_template_directory() . '/lib/importer/demos/fashion/onetone-pro-fashion.xml';
					$theme_options_file = get_template_directory() . '/lib/importer/demos/fashion/theme_options_fashion.txt';


					// Sidebar Widgets File
					$widgets_file = get_template_directory() . '/lib/importer/demos/fashion/widget_data_fashion.json';

					$layerslider_exists = false;
					$layer_directory = get_template_directory() . '/lib/importer/demos/fashion/layersliders/';

					$revslider_exists = false;
					$rev_directory = get_template_directory() . '/lib/importer/demos/fashion/revsliders/';

					// reading settings
					$homepage_title = 'Homepage';
					$posts_page_title='Blog';
			 break;
			 
			 case 'cafe':
					$shop_demo = false;
					$woo_xml   = get_template_directory() . '/lib/importer/demos/cafe/onetone-pro-cafe.xml';
					$theme_xml_file = get_template_directory() . '/lib/importer/demos/cafe/onetone-pro-cafe.xml';
					$theme_options_file = get_template_directory() . '/lib/importer/demos/cafe/theme_options_cafe.txt';


					// Sidebar Widgets File
					$widgets_file = get_template_directory() . '/lib/importer/demos/cafe/widget_data_cafe.json';

					$layerslider_exists = false;
					$layer_directory = get_template_directory() . '/lib/importer/demos/cafe/layersliders/';

					$revslider_exists = false;
					$rev_directory = get_template_directory() . '/lib/importer/demos/cafe/revsliders/';

					// reading settings
					$homepage_title = 'Homepage';
					$posts_page_title='Blog';
			 break;
			 
				case 'classic':
				default:
				
					$shop_demo = true;
					$woo_xml   = get_template_directory() . '/lib/importer/demos/classic/onetone-pro-classic.xml';
					$theme_xml_file = get_template_directory() . '/lib/importer/demos/classic/onetone-pro-classic.xml';
					$theme_options_file = get_template_directory() . '/lib/importer/demos/classic/theme_options_classic.txt';


					// Sidebar Widgets File
					$widgets_file = get_template_directory() . '/lib/importer/demos/classic/widget_data_classic.json';

					$layerslider_exists = true;
					$layer_directory = get_template_directory() . '/lib/importer/demos/classic/layersliders/';

					$revslider_exists = true;
					$rev_directory = get_template_directory() . '/lib/importer/demos/classic/revsliders/';

					// reading settings
					$homepage_title = 'Homepage';
					$posts_page_title='Blog';
			 break;

			}
			
			
			
			// Import Theme Options
			$theme_options_txt = $theme_options_file; // theme options data file
			//if( file_exists( $theme_options_txt ) ){
		
			$theme_options_txt = file_get_contents( $theme_options_txt );
			$options_data      = unserialize( base64_decode( $theme_options_txt )  );
			
			$table_name = $wpdb->prefix . "options";
		    $onetone_options = $wpdb->get_results( "SELECT * FROM $table_name WHERE option_name = 'onetone_pro'" );

			if(!empty($onetone_options)):
			
			$wpdb->update( 
							$table_name, 
							array( 
								'option_value' => base64_decode( $theme_options_txt ) ,
							), 
							array( 'option_name' => 'onetone_pro' ), 
							array( 
								'%s',	
							), 
							array( '%s' ) 
						);
			else:
			$wpdb->insert( 
							$table_name, 
							array( 
								 'option_name' => 'onetone_pro',
								 'option_value' => base64_decode( $theme_options_txt ),
								 'autoload' => 'no'
							), 
							array( 
								'%s', 
								'%s',
								'%s',
							) 
						);
			
			endif;
			
			

			add_filter('intermediate_image_sizes_advanced', 'onetone_filter_image_sizes');
			/* Import Woocommerce if WooCommerce Exists */
			if( class_exists('WooCommerce') && $shop_demo == true ) {
				$importer = new WP_Import();
				$theme_xml = $woo_xml;
				
				$importer->fetch_attachments = true;
				ob_start();
				$importer->import($theme_xml);
				ob_end_clean();

				// Set pages
				$woopages = array(
					'woocommerce_shop_page_id' => 'Shop',
					'woocommerce_cart_page_id' => 'Cart',
					'woocommerce_checkout_page_id' => 'Checkout',
					'woocommerce_pay_page_id' => 'Checkout &#8594; Pay',
					'woocommerce_thanks_page_id' => 'Order Received',
					'woocommerce_myaccount_page_id' => 'My Account',
					'woocommerce_edit_address_page_id' => 'Edit My Address',
					'woocommerce_view_order_page_id' => 'View Order',
					'woocommerce_change_password_page_id' => 'Change Password',
					'woocommerce_logout_page_id' => 'Logout',
					'woocommerce_lost_password_page_id' => 'Lost Password'
				);
				foreach($woopages as $woo_page_name => $woo_page_title) {
					$woopage = get_page_by_title( $woo_page_title );
					if(isset( $woopage ) && $woopage->ID) {
						update_option($woo_page_name, $woopage->ID); // Front Page
					}
				}

				// We no longer need to install pages
				delete_option( '_wc_needs_pages' );
				delete_transient( '_wc_activation_redirect' );

				// Flush rules after install
				flush_rewrite_rules();
			} else {
				$importer = new WP_Import();
				/* Import Posts, Pages, Portfolio Content, FAQ, Images, Menus */
				$theme_xml = $theme_xml_file;
				$importer->fetch_attachments = true;
				ob_start();
				$importer->import($theme_xml);
				ob_end_clean();

				flush_rewrite_rules();
			}

			// Set imported menus to registered theme locations
			$locations = get_theme_mod( 'nav_menu_locations' ); // registered menu locations in theme
			$menus = wp_get_nav_menus(); // registered menus

			if($menus) {
				if( $demo_type == 'classic' ) {
					$opmenu = get_page_by_title( 'Homepage - One page' );
				}
				foreach($menus as $menu) { // assign menus to theme locations
					if( $demo_type == 'classic' ) {
						if( $menu->name == 'All Pages' ) {
							$locations['primary'] = $menu->term_id;
						} else if( $menu->name == 'home' ) {
							$locations['home_menu'] = $menu->term_id;
						} 

						// Assign One Page Menu
					/*	if(isset( $opmenu ) && $opmenu->ID && $menu->name == 'home_menu') {
							update_post_meta($opmenu->ID, 'nav_menu', $menu->term_id);
						}*/
					} 
					if(  $demo_type == 'resume' ){
						
						if( $menu->name == 'All Pages' ) {
							$locations['primary'] = $menu->term_id;
						} 
						
						}
					}
				}
			}

			set_theme_mod( 'nav_menu_locations', $locations ); // set menus to locations

			

			// Add data to widgets
			if( isset( $widgets_file ) && $widgets_file ) {
				$widgets_json = $widgets_file; // widgets data file
				$widgets_json = file_get_contents( $widgets_json );
				$widget_data = $widgets_json;
				$import_widgets = magee_import_widget_data( $widget_data );
			}

			// Import Layerslider
			if( function_exists( 'layerslider_import_sample_slider' ) && $layerslider_exists == true ) { // if layerslider is activated
				// Get importUtil
				include WP_PLUGIN_DIR . '/LayerSlider/classes/class.ls.importutil.php';

				$layer_files = magee_get_import_files( $layer_directory, 'zip' );

				foreach( $layer_files as $layer_file ) { // finally import layer slider
					$import = new LS_ImportUtil($layer_file);
				}

				// Get all sliders
				// Table name
				$table_name = $wpdb->prefix . "layerslider";

				// Get sliders
				$sliders = $wpdb->get_results( "SELECT * FROM $table_name
													WHERE flag_hidden = '0' AND flag_deleted = '0'
													ORDER BY date_c ASC" );

				if(!empty($sliders)):
				foreach($sliders as $key => $item):
					$slides[$item->id] = $item->name;
				endforeach;
				endif;

				if($slides){
					foreach($slides as $key => $val){
						$slides_array[$val] = $key;
					}
				}

				// Assign LayerSlider
				/*if( $demo_type == 'classic' ) {
					
					$lspage = get_page_by_title( 'Layer Slider' );
					if(isset( $lspage ) && $lspage->ID && $slides_array['Avada Full Width']) {
						update_post_meta($lspage->ID, 'pyre_slider', $slides_array['Avada Full Width']);
					}
				}*/
			}

			// Import Revslider
			if( class_exists('UniteFunctionsRev') && $revslider_exists == true ) { // if revslider is activated
				$rev_files = magee_get_import_files( $rev_directory, 'zip' );

				$slider = new RevSlider();
				foreach( $rev_files as $rev_file ) { // finally import rev slider data files

					$filepath = $rev_file;
					
					$_FILES["import_file"]["tmp_name"] = $filepath;

					ob_start();
					$slider->importSliderFromPost(true, false, $filepath);
					ob_clean();
					ob_end_clean();
				}
			}

			

			// Set reading options
			//$homepage = get_page_by_title( $homepage_title );
			$posts_page = get_page_by_title( $posts_page_title );
			
			if(isset( $posts_page ) && $posts_page->ID ) {
				//update_option('show_on_front', 'page');
				//update_option('page_on_front', $homepage->ID); // Front Page
				update_option('page_for_posts', $posts_page->ID); // Blog Page
			}
 
			echo 'imported';

			exit;
		
	}
}

// Parsing Widgets Function
// Thanks to http://wordpress.org/plugins/widget-settings-importexport/
function magee_import_widget_data( $widget_data ) {
	$json_data = $widget_data;
	$json_data = json_decode( $json_data, true );

	$sidebar_data = $json_data[0];
	$widget_data  = $json_data[1];

	foreach ( $widget_data as $widget_data_title => $widget_data_value ) {
		$widgets[ $widget_data_title ] = '';
		foreach( $widget_data_value as $widget_data_key => $widget_data_array ) {
			if( is_int( $widget_data_key ) ) {
				$widgets[$widget_data_title][$widget_data_key] = 'on';
			}
		}
	}
	unset($widgets[""]);

	foreach ( $sidebar_data as $title => $sidebar ) {
		$count = count( $sidebar );
		for ( $i = 0; $i < $count; $i++ ) {
			$widget = array( );
			$widget['type']       = trim( substr( $sidebar[$i], 0, strrpos( $sidebar[$i], '-' ) ) );
			$widget['type-index'] = trim( substr( $sidebar[$i], strrpos( $sidebar[$i], '-' ) + 1 ) );
			if ( !isset( $widgets[$widget['type']][$widget['type-index']] ) ) {
				unset( $sidebar_data[$title][$i] );
			}
		}
		$sidebar_data[$title] = array_values( $sidebar_data[$title] );
	}

	foreach ( $widgets as $widget_title => $widget_value ) {
		foreach ( $widget_value as $widget_key => $widget_value ) {
			$widgets[$widget_title][$widget_key] = $widget_data[$widget_title][$widget_key];
		}
	}

	$sidebar_data = array( array_filter( $sidebar_data ), $widgets );

	magee_parse_import_data( $sidebar_data );
}

function magee_parse_import_data( $import_array ) {
	global $wp_registered_sidebars;
	$sidebars_data    = $import_array[0];
	$widget_data      = $import_array[1];
	$current_sidebars = get_option( 'sidebars_widgets' );
	$new_widgets      = array( );

	foreach ( $sidebars_data as $import_sidebar => $import_widgets ) :

		foreach ( $import_widgets as $import_widget ) :
			//if the sidebar exists
			if ( isset( $wp_registered_sidebars[$import_sidebar] ) ) :
				$title = trim( substr( $import_widget, 0, strrpos( $import_widget, '-' ) ) );
				$index = trim( substr( $import_widget, strrpos( $import_widget, '-' ) + 1 ) );
				$current_widget_data = get_option( 'widget_' . $title );
				$new_widget_name     = magee_get_new_widget_name( $title, $index );
				$new_index           = trim( substr( $new_widget_name, strrpos( $new_widget_name, '-' ) + 1 ) );

				if ( !empty( $new_widgets[ $title ] ) && is_array( $new_widgets[$title] ) ) {
					while ( array_key_exists( $new_index, $new_widgets[$title] ) ) {
						$new_index++;
					}
				}
				$current_sidebars[$import_sidebar][] = $title . '-' . $new_index;
				if ( array_key_exists( $title, $new_widgets ) ) {
					$new_widgets[$title][$new_index] = $widget_data[$title][$index];
					$multiwidget = $new_widgets[$title]['_multiwidget'];
					unset( $new_widgets[$title]['_multiwidget'] );
					$new_widgets[$title]['_multiwidget'] = $multiwidget;
				} else {
					$current_widget_data[$new_index] = $widget_data[$title][$index];
					$current_multiwidget = isset($current_widget_data['_multiwidget']) ? $current_widget_data['_multiwidget'] : false;
					$new_multiwidget = isset($widget_data[$title]['_multiwidget']) ? $widget_data[$title]['_multiwidget'] : false;
					$multiwidget = ($current_multiwidget != $new_multiwidget) ? $current_multiwidget : 1;
					unset( $current_widget_data['_multiwidget'] );
					$current_widget_data['_multiwidget'] = $multiwidget;
					$new_widgets[$title] = $current_widget_data;
				}

			endif;
		endforeach;
	endforeach;

	if ( isset( $new_widgets ) && isset( $current_sidebars ) ) {
		update_option( 'sidebars_widgets', $current_sidebars );

		foreach ( $new_widgets as $title => $content )
			update_option( 'widget_' . $title, $content );

		return true;
	}

	return false;
}

function magee_get_new_widget_name( $widget_name, $widget_index ) {
	$current_sidebars = get_option( 'sidebars_widgets' );
	$all_widget_array = array( );
	foreach ( $current_sidebars as $sidebar => $widgets ) {
		if ( !empty( $widgets ) && is_array( $widgets ) && $sidebar != 'wp_inactive_widgets' ) {
			foreach ( $widgets as $widget ) {
				$all_widget_array[] = $widget;
			}
		}
	}
	while ( in_array( $widget_name . '-' . $widget_index, $all_widget_array ) ) {
		$widget_index++;
	}
	$new_widget_name = $widget_name . '-' . $widget_index;
	return $new_widget_name;
}

if( function_exists( 'layerslider_import_sample_slider' ) ) {
	function onetone_import_sample_slider( $layerslider_data ) {
		// Base64 encoded, serialized slider export code
		$sample_slider = $layerslider_data;

		// Iterate over the sliders
		foreach($sample_slider as $sliderkey => $slider) {

			// Iterate over the layers
			foreach($sample_slider[$sliderkey]['layers'] as $layerkey => $layer) {

				// Change background images if any
				if(!empty($sample_slider[$sliderkey]['layers'][$layerkey]['properties']['background'])) {
					$sample_slider[$sliderkey]['layers'][$layerkey]['properties']['background'] = LS_ROOT_URL.'sampleslider/'.basename($layer['properties']['background']);
				}

				// Change thumbnail images if any
				if(!empty($sample_slider[$sliderkey]['layers'][$layerkey]['properties']['thumbnail'])) {
					$sample_slider[$sliderkey]['layers'][$layerkey]['properties']['thumbnail'] = LS_ROOT_URL.'sampleslider/'.basename($layer['properties']['thumbnail']);
				}

				// Iterate over the sublayers
				if(isset($layer['sublayers']) && !empty($layer['sublayers'])) {
					foreach($layer['sublayers'] as $sublayerkey => $sublayer) {

						// Only IMG sublayers
						if($sublayer['type'] == 'img') {
							$sample_slider[$sliderkey]['layers'][$layerkey]['sublayers'][$sublayerkey]['image'] = LS_ROOT_URL.'sampleslider/'.basename($sublayer['image']);
						}
					}
				}
			}
		}

		// Get WPDB Object
		global $wpdb;

		// Table name
		$table_name = $wpdb->prefix . "layerslider";

		// Append duplicate
		foreach($sample_slider as $key => $val) {

			// Insert the duplicate
			$wpdb->query(
				$wpdb->prepare("INSERT INTO $table_name
									(name, data, date_c, date_m)
								VALUES (%s, %s, %d, %d)",
								$val['properties']['title'],
								json_encode($val),
								time(),
								time()
				)
			);
		}
	}
}

// Rename sidebar
function onetone_name_to_class($name){
	$class = str_replace(array(' ',',','.','"',"'",'/',"\\",'+','=',')','(','*','&','^','%','$','#','@','!','~','`','<','>','?','[',']','{','}','|',':',),'',$name);
	return $class;
}



/*
* Returns all files in directory with the given filetype. Uses glob() for older
* php versions and recursive directory iterator otherwise.
*
* @param string $directory Directory that should be parsed
* @param string $filetype The file type
*
* @return array $files File names that match the $filetype
*/
function magee_get_import_files( $directory, $filetype ) {
	$phpversion = phpversion();
	$files = array();

	// Check if the php version allows for recursive iterators
	if ( version_compare( $phpversion, '5.2.11', '>' ) ) {
		if ( $filetype != '*' )  {
			$filetype = '/^.*\.' . $filetype . '$/';
		} else {
			$filetype = '/.+\.[^.]+$/';
		}
		$directory_iterator = new RecursiveDirectoryIterator( $directory );
		$recusive_iterator = new RecursiveIteratorIterator( $directory_iterator );
		$regex_iterator = new RegexIterator( $recusive_iterator, $filetype );

		foreach( $regex_iterator as $file ) {
			$files[] = $file->getPathname();
		}
	// Fallback to glob() for older php versions
	} else {
		if ( $filetype != '*' )  {
			$filetype = '*.' . $filetype;
		}

		foreach( glob( $directory . $filetype ) as $filename ) {
			$filename = basename( $filename );
			$files[] = $directory . $filename;
		}
	}

	return $files;
}

// Omit closing PHP tag to avoid "Headers already sent" issues.
<file_sep>/content-portfolio.php
<?php
global $orientation, $overlay_content,$post;
if( !$orientation ) $orientation = 'top';
if( !$overlay_content ) $overlay_content = '1';

//overlay_content: 1, button 2, title 3, title & tags 4, link

$taxonomy  = 'portfolio_tags';
$tax_terms = wp_get_post_terms($post->ID,$taxonomy);
$tags      = array();
if( $tax_terms ){
foreach ($tax_terms as $tax_term) {
$term_link = get_term_link( $tax_term );
   
    // If there was an error, continue to the next term.
    if ( is_wp_error( $term_link ) ) {
        continue;
    }
$tags[] = '<a href="' . esc_url( $term_link ) . '" title="' . sprintf( __( "View all posts in %s" ,'onetone'), $tax_term->name ) . '" ' . '>' . $tax_term->name.'</a>';
}
}
$tags_str = '';
if($tags)
$tags_str = implode(', ',$tags);

$action = 'from-'.$orientation;
if($overlay_content == '5')
$action = 'img-zoom-in';
?>
<article id="portfolio-<?php echo $post->ID;?>" class="portfolio-box" role="article">
  <div class="feature-img-box">
    <div class="img-box figcaption-middle text-center <?php echo $action;?> fade-in">
   <?php if($overlay_content == '2' || $overlay_content == '4' || $overlay_content == '5'):?>
   <a href="<?php the_permalink();?>">
   <?php endif;?>
      <?php 
														the_post_thumbnail("portfolio-thumb");
														$image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'large' );
														$featured_image = $image[0];
													  ?>
                                              <div class="img-overlay <?php if( $overlay_content == '4' ){echo 'light';} if( $overlay_content == '5' ){ echo 'primary';}?>">
                                                <div class="img-overlay-container">
                                                  <div class="img-overlay-content">
                                                    <?php if($overlay_content == '1'):?>
                                                    <div class="img-overlay-icons">
                                                    <a href="<?php the_permalink();?>"><i class="fa fa-link"></i></a>
                                                    <a rel="portfolio-image" href="<?php echo $featured_image;?>"><i class="fa fa-search"></i></a>
                                                     </div>
                                                    <?php endif;?>
                                                    <?php if($overlay_content == '2'):?>
                                                    <h3 class="img-overlay-title"><?php the_title();?></h3>
                                                    <?php endif;?>
                                                    <?php if($overlay_content == '3'):?>
                                                        <a href="<?php the_permalink();?>"><div class="img-overlay-total-link"></div></a>
                                                        <a href="<?php the_permalink();?>"><h3 class="img-overlay-title"><?php the_title();?></h3></a>
                                                        <div class="entry-category"><?php echo $tags_str;?></div>
                                                      <?php endif;?>
                                                      <?php if( $overlay_content == '4' || $overlay_content == '5' ):?>
                                                      <i class="fa fa-link"></i>
                                                      <?php endif;?>
                                                  </div>
                                                </div>
                                              </div>
                                              <?php if( $overlay_content == '2' || $overlay_content == '4' || $overlay_content == '5' ):?>
                                  </a>
                                  <?php endif;?>
                                            </div>
                                          </div>
                                          <div class="entry-main text-center">
                                            <div class="entry-header"> <a href="<?php the_permalink();?>">
                                              <h1 class="entry-title">
                                                <?php the_title();?>
                                              </h1>
                                              </a> </div>
                                            <div class="entry-meta">
                                              <div class="entry-category">
                                                <?php echo $tags_str; ?>
      </div>
    </div>
  </div>
</article>
<file_sep>/sidebar-woo_products_left.php
<?php
    $left_sidebar = esc_attr(onetone_option('left_sidebar_woo_products',''));

	 if ( $left_sidebar && is_active_sidebar( $left_sidebar ) ){
	 dynamic_sidebar( $left_sidebar );
	 }
	 elseif( is_active_sidebar( 'default_sidebar' ) ) {
	 dynamic_sidebar('default_sidebar');
	 }<file_sep>/pageprofileabout.php
<?php /* Template Name: About Template Profile */ 

  get_header('pagedefault'); 

?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
           
  <div class="entry-content">
    <div class="header-page">
      <h1> <?php echo the_title();?></h1>
    </div>

    <div class="post-wrap">
    
      <div class="">
        <div class="row no-aside">
          <div class="col-main">


            <div class="spinner-wrap">
         <div class="leftside"></div>
         <div class="rightside"></div>
        <div class="spinner">
            <div class="rect1"></div>
            <div class="rect2"></div>
            <div class="rect3"></div>
            <div class="rect4"></div>
            <div class="rect5"></div>
         </div> 
      </div>
      <section class="main-listing">
         <div class="container">
            <div class="row">
               <div class="col-md-12">
                  <section id="cd-timeline" class="cd-container">
                     <div class="cd-timeline-block year-block">
                        <div class="cd-timeline-year">
                           <h2>1999</h2>
                        </div>
                        <!-- cd-timeline-img -->
                     </div>
                     <!-- cd-timeline-block -->
                     <div class="cd-timeline-block post type-post status-publish format-image has-post-thumbnail sticky hentry category-image tag-image-2 post_format-post-format-image">
                        <div class="cd-timeline-img">
                           <h2>11</h2>
                           <p>Jul</p>
                        </div>
                        <!-- cd-timeline-img -->
                        <div class="cd-timeline-content box-panel selected-box-bordered  sticky-post box-panel selected-box-bordered">
                           <div class="cd-content clearfix">
                              <!-- <img width="515" height="290" src="http://10.0.1.178/timeliner/wp-content/uploads/2014/07/apx8EPiSnWoYHSEiUENI_14553734675_699b2aa038_o-515x290.jpg" class="attachment-box-item size-box-item wp-post-image" alt="Peace" srcset="http://10.0.1.178/timeliner/wp-content/uploads/2014/07/apx8EPiSnWoYHSEiUENI_14553734675_699b2aa038_o-300x169.jpg 300w, http://10.0.1.178/timeliner/wp-content/uploads/2014/07/apx8EPiSnWoYHSEiUENI_14553734675_699b2aa038_o-1024x576.jpg 1024w, http://10.0.1.178/timeliner/wp-content/uploads/2014/07/apx8EPiSnWoYHSEiUENI_14553734675_699b2aa038_o-800x450.jpg 800w, http://10.0.1.178/timeliner/wp-content/uploads/2014/07/apx8EPiSnWoYHSEiUENI_14553734675_699b2aa038_o-515x289.jpg 515w, http://10.0.1.178/timeliner/wp-content/uploads/2014/07/apx8EPiSnWoYHSEiUENI_14553734675_699b2aa038_o.jpg 1080w" sizes="(max-width: 515px) 100vw, 515px" />                    -->
                              <img width="515" height="290" src="http://www.nubelo.com/blog/wp-content/uploads/2012/11/bornglobal600.jpg">
                              <div class="content-padding">
                                 <a href="image-post-format/index.html" class="post-title">
                                    <h2>Nacimiento de Profile</h2>
                                 </a>
                                 <div class="post-content">
                                    <p>Profile nace con la voluntad de cubrir necesidades de servicios de outsourcing de Consultoría, Análisis y Programación del ERP JdEwards en sus dos versiones, One World y World Software.</p>
                                 </div>
                                 <div class="clearfix"></div>
                                 <div class="cd-author">
                                    <img src="http://10.0.1.178/timeliner/wp-content/uploads/2014/09/5KY7898-150x150.png" class="media-object img-responsive" alt="" />
                                 </div>
                              </div>
                           </div>
                        </div>
                        <!-- cd-timeline-content -->
                     </div>
                     <div class="cd-timeline-block post type-post status-publish format-standard hentry category-standard tag-gmap tag-standard-2">
                        <div class="cd-timeline-img">
                           <h2>11</h2>
                           <p>Jul</p>
                        </div>
                        <!-- cd-timeline-img -->
                        <div class="cd-timeline-content box-panel selected-box-bordered  ">
                           <div class="cd-content clearfix">
                              <div class="embed-responsive embed-responsive-16by9">
                                 <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d889.832160056289!2d2.1588905933821776!3d41.39522664213615!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x12a4a291593588d9%3A0x99247f25b11b0371!2sCarrer+del+Rossell%C3%B3%2C+253%2C+08008+Barcelona!5e0!3m2!1ses!2ses!4v1458059919302" class="embed-responsive-item"></iframe>

                              </div>
                              <div class="content-padding">
                                 <a href="standard-post-format-with-gmap/index.html" class="post-title">
                                    <h2>Abrimos las oficinas de Barcelona</h2>
                                 </a>
                                 <div class="post-content">
                                    <p>Nacen las oficinas de Barcelona.</p>
                                 </div>
                                 <div class="clearfix"></div>
                                 <div class="cd-author">
                                    <img src="http://10.0.1.178/timeliner/wp-content/uploads/2014/09/sally-150x150.png" class="media-object img-responsive" alt="" />
                                 </div>
                              </div>
                           </div>
                        </div>
                        <!-- cd-timeline-content -->
                     </div>
                    <div class="cd-timeline-block year-block">
                        <div class="cd-timeline-year">
                           <h2>2001</h2>
                        </div>
                        <!-- cd-timeline-img -->
                     </div>
                     <!-- cd-timeline-block -->
                     <div class="cd-timeline-block even post type-post status-publish format-video hentry category-video tag-video-2 tag-youtube post_format-post-format-video">
                        <div class="cd-timeline-img">
                           <h2>11</h2>
                           <p>Jul</p>
                        </div>
                        <!-- cd-timeline-img -->
                        <div class="cd-timeline-content box-panel selected-box-bordered  ">
                           <div class="cd-content clearfix">
                              <div class="embed-responsive embed-responsive-16by9">
                                 <iframe src="http://www.youtube.com/embed/MSMDgMhfM_M?rel=0" class="embed-responsive-item"></iframe>
                              </div>
                              <div class="content-padding">
                                 <a href="youtube-video/index.html" class="post-title">
                                    <h2>Ampliación de tecnologías</h2>
                                 </a>
                                 <div class="post-content">
                                    <p>Tras situarse rápidamente como uno de los líderes en este mercado, en el año 2001 inicia su ampliación hacia otro tipo de tecnologías entre las que se encuentran los entornos de SAP, Java, .Net o Cobol.</p>
                                 </div>
                                 <div class="clearfix"></div>
                                 <div class="cd-author">
                                    <img src="http://10.0.1.178/timeliner/wp-content/uploads/2014/09/john-150x150.png" class="media-object img-responsive" alt="" />
                                 </div>
                              </div>
                           </div>
                        </div>
                        <!-- cd-timeline-content -->
                     </div>
                     <!-- cd-timeline-block -->
                     <div class="cd-timeline-block year-block">
                        <div class="cd-timeline-year">
                           <h2>2006</h2>
                        </div>
                        <!-- cd-timeline-img -->
                     </div>
                     <div class="cd-timeline-block post type-post status-publish format-audio has-post-thumbnail hentry category-audio tag-audio-2 tag-background post_format-post-format-audio">
                        <div class="cd-timeline-img">
                           <h2>11</h2>
                           <p>Jul</p>
                        </div>
                        <!-- cd-timeline-img -->
                        <div class="cd-timeline-content box-panel selected-box-bordered  ">
                           <div class="cd-content clearfix">
                              <div class="embed-responsive embed-responsive-16by9">
                                 <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3037.1754128475377!2d-3.6965095840046636!3d40.42711456293062!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xd42288e41f83c2f%3A0xce1a826d4f6ecb85!2sCalle+de+G%C3%A9nova%2C+11%2C+28004+Madrid!5e0!3m2!1ses!2ses!4v1458060324999" class="embed-responsive-item"></iframe>

                              </div>
                              <div class="content-padding">
                                 <a href="standard-post-format-with-gmap/index.html" class="post-title">
                                    <h2>Nos expandimos a Madrid</h2>
                                 </a>
                                 <div class="post-content">
                                    <p>Profile abre sus oficinas en Madrid</p>
                                 </div>
                                 <div class="clearfix"></div>
                                 <div class="cd-author">
                                    <img src="http://10.0.1.178/timeliner/wp-content/uploads/2014/09/sally-150x150.png" class="media-object img-responsive" alt="" />
                                 </div>
                              </div>
                           </div>
                        </div>
                        <!-- cd-timeline-content -->
                     </div>

                     <!-- cd-timeline-block -->
                     <div class="cd-timeline-block even post type-post status-publish format-link has-post-thumbnail hentry category-link tag-google tag-link-2 post_format-post-format-link">
                        <div class="cd-timeline-img">
                           <h2>11</h2>
                           <p>Jul</p>
                        </div>
                        <!-- cd-timeline-img -->
                        <div class="cd-timeline-content box-panel selected-box-bordered  content-bg ">
                           <div class="bg-image" style="background-image: url( 'http://10.0.1.178/timeliner/wp-content/uploads/2014/07/lSed5VXIQnOw7PMfB9ht_IMG_1642-800x450.jpg' ); background-size: cover;">
                              <div class="overlay">
                                 <a href="http://www.google.com">
                                    <h2 class="break-word">http://www.profile.es</h2>
                                 </a>
                              </div>
                           </div>
                           <div class="cd-content">
                              <div class="cd-author">
                                 <img src="http://10.0.1.178/timeliner/wp-content/uploads/2014/09/kdzhOFb-150x150.png" class="media-object img-responsive" alt="" />
                              </div>
                           </div>
                        </div>
                     </div>
                    <div class="cd-timeline-block year-block">
                        <div class="cd-timeline-year">
                           <h2>2007</h2>
                        </div>
                        <!-- cd-timeline-img -->
                     </div>
                     <!-- cd-timeline-block -->
                     <div class="cd-timeline-block post type-post status-publish format-status has-post-thumbnail hentry category-status tag-status-2 tag-twitter post_format-post-format-status">
                        <div class="cd-timeline-img">
                           <h2>11</h2>
                           <p>Jul</p>
                        </div>
                        <!-- cd-timeline-img -->
                        <div class="cd-timeline-content box-panel selected-box-bordered  ">
                           <div class="cd-content clearfix">
                              <img width="515" height="343" src="http://pymematica.com/wp-content/uploads/2015/08/factores-seo-2016.jpg" class="attachment-box-item size-box-item wp-post-image" alt="Safe"/>                    
                              <div class="content-padding">
                                 <a href="status-with-background/index.html" class="post-title">
                                    <h2>Ampliamos perfiles y servicios</h2>
                                 </a>
                                 <div class="post-content">
                                    <p> Profile inicia otra ampliación de perfiles ofreciendo servicios más especializados como son los de Quality Assurance, Software Testing, Front End o SEO.</p>
                                 </div>
                                 <div class="clearfix"></div>
                                 <div class="cd-author">
                                    <img src="http://10.0.1.178/timeliner/wp-content/uploads/2014/09/5KY7898-150x150.png" class="media-object img-responsive" alt="" />
                                 </div>
                              </div>
                           </div>
                        </div>
                        <!-- cd-timeline-content -->
                     </div>
                     <!-- cd-timeline-block -->
                    <div class="cd-timeline-block year-block">
                        <div class="cd-timeline-year">
                           <h2>2011</h2>
                        </div>
                        <!-- cd-timeline-img -->
                     </div>
                     <div class="cd-timeline-block even post type-post status-publish format-gallery hentry category-galleries tag-gallery tag-slider post_format-post-format-gallery">
                        <div class="cd-timeline-img">
                           <h2>11</h2>
                           <p>Jul</p>
                        </div>
                        <!-- cd-timeline-img -->
                        <div class="cd-timeline-content box-panel selected-box-bordered  ">
                           <div class="cd-content clearfix">
                              <ul class="list-unstyled post-slider">
                                 <li><img width="515" height="289" src="http://10.0.1.178/timeliner/wp-content/uploads/2014/07/skater-515x289.jpg" class="attachment-gallery-box-item size-gallery-box-item" alt="Fun" srcset="http://10.0.1.178/timeliner/wp-content/uploads/2014/07/skater-800x450.jpg 800w, http://10.0.1.178/timeliner/wp-content/uploads/2014/07/skater-515x289.jpg 515w" sizes="(max-width: 515px) 100vw, 515px" /></li>
                                 <li><img width="515" height="289" src="http://10.0.1.178/timeliner/wp-content/uploads/2014/07/pHyYeNZMRFOIRpYeW7X3_manacloseup-copy-515x289.jpg" class="attachment-gallery-box-item size-gallery-box-item" alt="Amaizing" srcset="http://10.0.1.178/timeliner/wp-content/uploads/2014/07/pHyYeNZMRFOIRpYeW7X3_manacloseup-copy-800x450.jpg 800w, http://10.0.1.178/timeliner/wp-content/uploads/2014/07/pHyYeNZMRFOIRpYeW7X3_manacloseup-copy-515x289.jpg 515w" sizes="(max-width: 515px) 100vw, 515px" /></li>
                                 <li><img width="515" height="289" src="http://10.0.1.178/timeliner/wp-content/uploads/2014/07/gQZ2iaRdRoWKahCTncS1_brooklyn-bridge-515x289.jpg" class="attachment-gallery-box-item size-gallery-box-item" alt="Bridge" srcset="http://10.0.1.178/timeliner/wp-content/uploads/2014/07/gQZ2iaRdRoWKahCTncS1_brooklyn-bridge-800x450.jpg 800w, http://10.0.1.178/timeliner/wp-content/uploads/2014/07/gQZ2iaRdRoWKahCTncS1_brooklyn-bridge-515x289.jpg 515w" sizes="(max-width: 515px) 100vw, 515px" /></li>
                                 <li><img width="515" height="289" src="http://10.0.1.178/timeliner/wp-content/uploads/2014/07/90PZOijCSquhzM1A3cq8_photo-515x289.jpg" class="attachment-gallery-box-item size-gallery-box-item" alt="Empty" srcset="http://10.0.1.178/timeliner/wp-content/uploads/2014/07/90PZOijCSquhzM1A3cq8_photo-800x450.jpg 800w, http://10.0.1.178/timeliner/wp-content/uploads/2014/07/90PZOijCSquhzM1A3cq8_photo-515x289.jpg 515w" sizes="(max-width: 515px) 100vw, 515px" /></li>
                              </ul>
                              <div class="content-padding">
                                 <a href="slider-gallery/index.html" class="post-title">
                                    <h2>Nace IROS</h2>
                                 </a>
                                 <div class="post-content">
                                    <p>Los socios de Profile crean, junto con un antiguo empleado, otra empresa, Intelligent Resources Optimization Services (IROS) de la que Profile se convierte en partner comercial. Su misión es dar servicios de optimización de los recursos comerciales de las grandes empresas, mediante el uso de tecnologías avanzadas propias y de terceros.</p>
                                 </div>
                                 <div class="clearfix"></div>
                                 <div class="cd-author">
                                    <img src="http://10.0.1.178/timeliner/wp-content/uploads/2014/09/john-150x150.png" class="media-object img-responsive" alt="" />
                                 </div>
                              </div>
                           </div>
                        </div>
                        <!-- cd-timeline-content -->
                     </div>
                     <div class="cd-timeline-block year-block">
                        <div class="cd-timeline-year">
                           <h2>2014</h2>
                        </div>
                        <!-- cd-timeline-img -->
                     </div>
                     <!-- cd-timeline-block -->
                     <div class="cd-timeline-block post type-post status-publish format-standard hentry category-standard tag-gmap tag-standard-2">
                        <div class="cd-timeline-img">
                           <h2>11</h2>
                           <p>Jul</p>
                        </div>
                        <!-- cd-timeline-img -->
                        <div class="cd-timeline-content box-panel selected-box-bordered  ">
                           <div class="cd-content clearfix">
                              <div class="embed-responsive embed-responsive-16by9">
                                 <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3011.4837381894595!2d0.9211394160049433!3d40.99278422832577!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x12a14060f5eaeaf3%3A0x7ec79747ffd8b96a!2sVia+Augusta%2C+2%2C+43890+L&#39;Hospitalet+de+l&#39;Infant%2C+Tarragona!5e0!3m2!1ses!2ses!4v1458061303700"></iframe>

                              </div>
                              <div class="content-padding">
                                 <a href="standard-post-format-with-gmap/index.html" class="post-title">
                                    <h2>Nace el CDA a Tarragona</h2>
                                 </a>
                                 <div class="post-content">
                                    <p>Nace el centro de desarrollo Ágil en Tarrragona</p>
                                 </div>
                                 <div class="clearfix"></div>
                                 <div class="cd-author">
                                    <img src="http://10.0.1.178/timeliner/wp-content/uploads/2014/09/sally-150x150.png" class="media-object img-responsive" alt="" />
                                 </div>
                              </div>
                           </div>
                        </div>
                     </div>
                      <div class="cd-timeline-block year-block">
                        <div class="cd-timeline-year">
                           <h2>2015</h2>
                        </div>
                        <!-- cd-timeline-img -->
                     </div>
                     <!-- cd-timeline-block -->
                     <div class="cd-timeline-block even post type-post status-publish format-standard hentry category-standard tag-standard-2">
                        <div class="cd-timeline-img">
                           <h2>11</h2>
                           <p>Jul</p>
                        </div>
                        <!-- cd-timeline-img -->
                        <div class="cd-timeline-content box-panel selected-box-bordered  ">
                           <div class="cd-content clearfix">
                              <div class="embed-responsive embed-responsive-16by9">
                                 <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2896.422116127657!2d-3.8780926839516523!3d43.45178387344852!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xd49485a0100ed05%3A0xf1529d22c236641f!2sUNEATLANTICO+-+Universidad+Europea+del+Atl%C3%A1ntico!5e0!3m2!1ses!2ses!4v1458061450523"></iframe>

                              </div>
                              <div class="content-padding">
                                 <a href="standard-post-format-with-gmap/index.html" class="post-title">
                                    <h2><NAME></h2>
                                 </a>
                                 <div class="post-content">
                                    <p><NAME></p>
                                 </div>
                                 <div class="clearfix"></div>
                                 <div class="cd-author">
                                    <img src="http://10.0.1.178/timeliner/wp-content/uploads/2014/09/sally-150x150.png" class="media-object img-responsive" alt="" />
                                 </div>
                              </div>
                           </div>
                        </div>
                     </div>
                     <div class="cd-timeline-block even post type-post status-publish format-standard hentry category-standard tag-standard-2">
                        <div class="cd-timeline-img">
                           <h2>11</h2>
                           <p>Jul</p>
                        </div>
                        <!-- cd-timeline-img -->
                        <div class="cd-timeline-content box-panel selected-box-bordered  ">
                           <div class="cd-content clearfix">
                              <div class="embed-responsive embed-responsive-16by9">
                                 <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3010.6801597225904!2d0.9069539160052354!3d41.01037322724353!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x12a1409c2176005d%3A0x1cc592b91602373d!2sCarrer+Rivera+Sans%2C+5%2C+43890%2C+Tarragona!5e0!3m2!1ses!2ses!4v1458061549029"></iframe>

                              </div>
                              <div class="content-padding">
                                 <a href="standard-post-format-with-gmap/index.html" class="post-title">
                                    <h2>Ampliamos las oficinas del CDA de Tarragona</h2>
                                 </a>
                                 <div class="post-content">
                                    <p>El CDA Se amplia y se traslada de oficinas</p>
                                 </div>
                                 <div class="clearfix"></div>
                                 <div class="cd-author">
                                    <img src="http://10.0.1.178/timeliner/wp-content/uploads/2014/09/sally-150x150.png" class="media-object img-responsive" alt="" />
                                 </div>
                              </div>
                           </div>
                        </div>
                     </div>                     

                     <!-- cd-timeline-block -->
                     <div class="cd-timeline-block load-more-block">
                        <div class="cd-timeline-year">
                           <h2><a href="javascript:;" class="load-more" data-next_link="http://demo.djmimi.net/themes/timeliner/page/2/">...</a></h2>
                        </div>
                        <!-- cd-timeline-img -->
                     </div>
                     <!-- cd-timeline-block -->
                  </section>
               </div>
            </div>
         </div>
      <link rel='stylesheet' id='mediaelement-css'  href='<?php echo get_site_url(); ?>/bower_components/mediaelement/build/mediaelementplayer.min.css' type='text/css' media='all' />

      <script type='text/javascript' src='<?php echo get_site_url(); ?>/wp-content/themes/onetone/js/responsiveslides.min-ver=4.4.2.js'></script>
      <script type='text/javascript' src='<?php echo get_site_url(); ?>/wp-content/themes/onetone/js/modernizr-ver=4.4.2.js'></script>
      <script type='text/javascript' src='<?php echo get_site_url(); ?>/wp-content/themes/onetone/js/jquery.magnific-popup.min-ver=4.4.2.js'></script>
      <script type='text/javascript' src='<?php echo get_site_url(); ?>/wp-content/themes/onetone/js/custom-ver=4.4.2.js'></script>
      <script type='text/javascript' src='<?php echo get_site_url(); ?>/wp-includes/js/wp-embed.min.js'></script>

      <script type='text/javascript' src='<?php echo get_site_url(); ?>/bower_components/mediaelement/build/mediaelement-and-player.min.js'></script>
      <script type='text/javascript' src='<?php echo get_site_url(); ?>/wp-includes/js/mediaelement/wp-mediaelement.js'></script>
      </section>
          </div>
        </div>
      </div>
    </div>
  </article>

      

<?php




 get_footer(); ?>

<file_sep>/pageprofileservicios.php
<?php /* Template Name: Servicios Template Profile */

  get_header('pagedefault');

?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

   <div class="entry-content">
      <div class="header-page header-servicios">
         <h1> <?php echo the_title();?></h1>
      </div>
      <div class="post-wrap">
         <div class="bgcolorf4">
            <div class="container servicios">
               <div class="row">
                  <div class="col-md-8">
                     <h1 class="cprofile">Introducción</h1>
                     <h3>Texto entradilla que resulta lo que va contener la página, conclusión.</h3>
                     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti dolorem ducimus, saepe aliquam, totam impedit veniam officiis est et aliquid in voluptas necessitatibus nulla non. Quibusdam reprehenderit, mollitia consequuntur totam.</p>

                  </div>
                  <div class="col-md-4">
                     <img class="img-servicios" src="<?= get_bloginfo('template_directory'); ?>/images/ico-40.png">
                  </div>
               </div>
            </div>
         </div>
         <div class="separator my-arrow-servicios ">
            <div class="home-container container">
               <h1 class="text-center negative">Big Data</h1>
               <div class="home-section-content">
               </div>
            </div>
            <div class="clear"></div>
         </div>
         <div class="container servicios">
            <div class="row">
               <div class="col-md-4 text-center">
                  <img class="img-servicios" src="<?= get_bloginfo('template_directory'); ?>/images/servicios/bigdata.png" alt="">
               </div>
                <div class="testimonial-servicios block clearfix col-md-8">
                  <div class="description">
                     La información es el petróleo del siglo XXI, y la analítica Big Data es el motor.
                  </div>
                  <div class="author">
                     <NAME>, Gartner Research
                  </div>
               </div>
            </div>
         </div>
         <div class="bgcolorf4">
            <div class="container servicios">
               <div class="row">
                  <div class="col-md-6 col-xs-6">
                     <div class="col-md-4 col-img"><img src="<?= get_bloginfo('template_directory'); ?>/images/ico-47.png" /></div>
                     <div class="col-md-8">
                        <h3>Big Data Open Source</h3>
                        <h5 class="servicios-apartado-entradilla">Hadoop, Spark, Storm, Kafka, Flume, Impala, Pig, Hive... en instalación local o en cloud.</h5>
                        <p>El ecosistema open source para análisis de datos es potente y flexible. Las arquitecturas big data basadas en open source permiten análisis de datos distribuido a cualquier escala.</p>
                     </div>
                  </div>
                  <div class="col-md-6 col-xs-6">
                     <div class="col-md-4 col-img"><img src="<?= get_bloginfo('template_directory'); ?>/images/ico-49.png" /></div>
                     <div class="col-md-8">
                        <h3>NoSQL</h3>
                        <h5 class="servicios-apartado-entradilla">Sistemas de almacenamiento.</h5>
                        <p>Las bases de datos NoSQL como MongoDB nos permiten gran agilidad durante el desarrollo y una mayor flexibilidad y potencia de explotación que las bases de datos tradicionales.</p>
                     </div>
                  </div>
               </div>
               <div class="row nomargintop">
                  <div class="col-md-6 col-xs-6">
                     <div class="col-md-4 col-img"><img src="<?= get_bloginfo('template_directory'); ?>/images/ico-48.png" /></div>
                     <div class="col-md-8">
                        <h3>Data-Driven Business Strategy</h3>
                        <h5 class="servicios-apartado-entradilla">Estrategia de datos, data exploration.</h5>
                        <p>Como paso inicial hacia convertirse en una compañía con orientación a los datos, es conveniente definir una estrategia alrededor de todo el ciclo de vida de los datos y realizar una exploración inicial para generar ideas alrededor de estos datos.</p>
                     </div>
                  </div>
                  <div class="col-md-6 col-xs-6">
                     <div class="col-md-4 col-img"><img src="<?= get_bloginfo('template_directory'); ?>/images/ico-50.png" /></div>
                     <div class="col-md-8">
                        <h3>Logtrust</h3>
                        <h5 class="servicios-apartado-entradilla">Análisis en tiempo real</h5>
                        <p>Logtrust nos permite dar soluciones para análisis de tiempo real bajo un modelo ágil y flexible, desde la ingesta de datos hasta la visualización del análisis y la toma de decisiones.</p>
                     </div>
                  </div>
               </div>
            </div>
         </div>
         <div class="separator my-arrow-servicios ">
            <div class="home-container container">
               <h1 class="text-center negative">Cloud Computing</h1>
               <div class="home-section-content">
               </div>
            </div>
            <div class="clear"></div>
         </div>
         <div class="container servicios">
            <div class="row">
               <div class="col-md-8">
                  <h1 class="cprofile">Lorem Ipsum</h1>
                  <h3>Texto entradilla que resulta lo que va contener la página, conclusión.</h3>
                  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti dolorem ducimus, saepe aliquam, totam impedit veniam officiis est et aliquid in voluptas necessitatibus nulla non. Quibusdam reprehenderit, mollitia consequuntur totam.</p>

               </div>
               <div class="col-md-4">
                  <img class="img-servicios" src="<?= get_bloginfo('template_directory'); ?>/images/servicios/default.jpg">
               </div>
            </div>
         </div>
         <div class="bgcolorf4">
            <div class="container">
               <div class="row">
                  <div class="col-md-4">
                     <div class="col-md-12">
                        <img class="img-servicios" src="http://placeimg.com/400/200/tech" />
                        <h3>LaaS</h3>
                        <label>Infraestructura como servicio</label>
                        <p class="service-separator">La nube nos ofrece una capacidad de proceso y almacenamiento que hata ahora estaba sólo al alcance de pocos.</p>
                        <p>Hoy, diseñamos una infraestructura y sólo con unos clicks, conseguimos materializarla y ponerla en funcionamiento.</p>
                     </div>
                  </div>
                  <div class="col-md-4">
                     <div class="col-md-12">
                        <img class="img-servicios" src="http://placeimg.com/400/201/tech" />
                        <h3>PaaS</h3>
                        <label>Plataformas tecnológicas ágiles</label>
                        <p class="service-separator">Gracias a los productos PaaS (Platform as a service) podemos centrarnos en lo que hacemos bien: escribir código de alta calidad y ponerlo en marcha.</p>
                        <p>Empezamos subiendo código al repositorio, creamos un entorno escalable y con alta disponibilidad en cloud, y ponemos la aplicación a correr en minutos.</p>
                     </div>
                  </div>
                  <div class="col-md-4">
                     <div class="col-md-12">
                        <img class="img-servicios" src="http://placeimg.com/401/200/tech" />
                        <h3>SaaS</h3>
                        <label>Soluciones software flexibles</label>
                        <p class="service-separator">No tratamos de reinventar la rueda. En ocasiones es mejor utilizar un servicio (Software as a service) que agilice nuestro desarrollo.</p>
                        <p>Conectamos servicios y construimos aplicaciones a partir de las mejores piezas.</p>
                     </div>
                  </div>
               </div>
            </div>
         </div>
         <div class="separator my-arrow-servicios ">
            <div class="home-container container">
               <h1 class="text-center negative">User experience</h1>
               <div class="home-section-content">
               </div>
            </div>
            <div class="clear"></div>
         </div>
         <div class="container servicios">
            <div class="row">
               <div class="col-md-8">
                  <h1 class="cprofile">Diseño centrado en el usuario</h1>
                  <h3>Una experiencia de usuario efectiva es la que consigue una interacción agradable, intuitiva y usable, sencilla pero completa.</h3>
                  <p>La perfección no consiste en poner, sino en quitar hasta dejar sólo lo imprescindible. Uno de los principios Lean es que lo que no aporta ningún valor al producto, sobra. El diseño de UX se alinea con los objetivos de la empresa para aportar el máximo valor en el menor tiempo posible.</p>
               </div>
               <div class="col-md-4">
                  <img class="img-servicios" src="http://localhost/web-profile/wp-content/themes/onetone/images/servicios/default.jpg">
               </div>
            </div>
         </div>
         <div class="bgcolorf4">
            <div class="container servicios">
               <div class="row">
                  <div class="col-md-7">
                     <div class="col-md-2">
                        <img src="http://placeimg.com/200/300/tech" />
                     </div>
                     <div class="col-md-10">
                        <h3>Patrones de diseño</h3>
                        <h5>Se facilita el uso siguiendo patrones universales y convenciones culturales.</h5>
                        <p>Se usan affordances para reducir la carga cognitiva y se establecen estrategias para influir en la percepción del usuario mediante la manipulación de los patrones de exploración, el flujo y la jerarquía visual.</p>
                     </div>
                     <div class="col-md-2">
                        <img src="http://placeimg.com/201/300/tech" />
                     </div>
                     <div class="col-md-10">
                        <h3>Tests de usuario</h3>
                        <h5>Si el producto se adecua al usuario final aumenta su probabilidad de éxito.</h5>
                        <p>A través de encuestas, entrevistas, focus group como con test A/B y tests de usabilidad. Los tests se realizan en las fases de conceptualización y durante el desarrollo, ya sea presenciales o a distáncia, cualitativos o cuantitativos.</p>
                     </div>
                  </div>
                  <div class="col-md-5">
                     <div class="col-md-3 col-img">
                        <img src="http://placeimg.com/200/301/tech" />
                     </div>
                     <div class="col-md-9">
                        <h3>Prototipado</h3>
                        <h5>Mediante la co-creación el quipo suma, a la vez que se consigue empatizar.</h5>
                        <p>Con la información extraída del análisis de requisitos el equipo puede realizar diferentes prototipos, variando cúales según fase y necesidades del proyecto.</p>
                        <ul class="list-unordered">
                           <li>Personas</li>
                           <li>Escenarios</li>
                           <li>Flujos de navegación</li>
                           <li>Storyboards</li>
                           <li>Paper prototypes</li>
                           <li>Whiteboards</li>
                           <li>Wireframes de baja resolución</li>
                           <li>Wireframes de alta resolución</li>
                           <li>Prototipos interactivos estáticos</li>
                           <li>Prototipos interactivos dinámicos</li>
                        </ul>
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>
</article>



<?php




 get_footer(); ?>

<file_sep>/taxonomy-portfolio-category.php
<?php
/**
* The sigle template file.
*
*/
get_header(); 
$related_number = absint(onetone_option('related_number','8'));
   
$left_sidebar   = onetone_option('left_sidebar_portfolio_archive');
$right_sidebar  = onetone_option('right_sidebar_portfolio_archive');
$aside          = 'no-aside';
if( $left_sidebar !='' )
$aside          = 'left-aside';
if( $right_sidebar !='' )
$aside          = 'right-aside';
if(  $left_sidebar !='' && $right_sidebar !='' )
$aside          = 'both-aside';

?>
<div id="portfolio-cat">
<section class="page-title-bar title-left no-subtitle" style="">
            <div class="container">
                <hgroup class="page-title">
                    <h1><?php single_cat_title();?></h1>
                </hgroup>
                <?php onetone_get_breadcrumb(array("before"=>"<div class=''>","after"=>"</div>","show_browse"=>false,"separator"=>'','container'=>'div'));?> 
                <div class="clearfix"></div>            
            </div>
        </section>
<div class="post-wrap">
            <div class="container">
                <div class="post-inner row <?php echo $aside; ?>">
                    <div class="col-main">
                        <section class="post-main" role="main" id="content">
                         <?php if (have_posts()) : ?>
                     <?php
							$items  = "" ;
							$i      = 1 ;
							$result = "" ;
							while ( have_posts() ) : the_post(); 
							$portfolio_image = "";
							if (has_post_thumbnail( get_the_ID()) ): 
							$thumb = get_the_post_thumbnail( get_the_ID() , "portfolio-grid-thumb" ); 
							//$image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'large' );
							//$portfolio_image = $image[0];
							endif;
							
							$tags = get_the_tags(get_the_ID());
	   $tags_list = '<ul>';
	   if(is_array($tags)){
	   foreach ( $tags as $tag ) {
		  $tag_link   = get_tag_link( $tag->term_id );
		  $tags_list .= "<li><a href='{$tag_link}' title='{$tag->name}' class='{$tag->slug}'>";
		  $tags_list .= "{$tag->name}</a></li>";
	     }
	   }
	  $tags_list .= '</ul>';
	   $items  .=  '<div class="portfolio-col col-sm-4"><div class="portfolio-box text-center">';
	   $items  .=  '<a href="'.get_permalink().'">';
	   $items  .= $thumb;
	   $items  .=  '</a>'; 
					
	  $items  .=  '<div class="portfolio-box-title"><a href="'.get_permalink().'"><h3>'.get_the_title().'</h3></a>
	  									'.$tags_list.'
									</div>
								</div>
							</div>';

						if($i%3 == 0){
							$result .=  '<div class="row">'.$items.'</div>';
							$items   = "";
							}
						$i++;
					  endwhile;
					  if($items != "")
					  $result = $result.'<div class="row">'.$items.'</div>';
					  
					  echo  $result;
					  ?>

					<div class="list-pagition text-center">
						<?php onetone_native_pagenavi("echo",$wp_query);?>	
					</div>
                    <?php else:?>
                    <div style="width:100%; text-align:center; margin-bottom:30px;">
                    <?php _e("Nothing found.","onetone");?>
                    </div>
                    <?php endif; ?>
                            
                        </section>
                    </div>
                    <?php if( $left_sidebar !='' ):?>
                    <div class="col-aside-left">
                        <aside class="blog-side left text-left">
                             <?php get_sidebar('portfolioleft');?> 
                        </aside>
                    </div>
                    <?php endif; ?>
                    <?php if( $right_sidebar !='' ):?>
                    <div class="col-aside-right">
                        <?php get_sidebar('portfolioright');?>
                    </div>
                     <?php endif; ?>
                </div>
            </div>  
        </div>

</div>
<?php get_footer(); ?><file_sep>/readme.txt
Corporate Theme
================

##<file_sep>/index.php
<?php
/**
* The main template file.
*
*/
 ?>
<?php
if ( 'page' == get_option( 'show_on_front' ) && ( '' != get_option( 'page_for_posts' ) ) && $wp_query->get_queried_object_id() == get_option( 'page_for_posts' ) ) :
get_header(); 
else:
get_header('home'); 
endif;
?>
<?php
if ( 'page' == get_option( 'show_on_front' ) && ( '' != get_option( 'page_for_posts' ) ) && $wp_query->get_queried_object_id() == get_option( 'page_for_posts' ) ) :

$left_sidebar   = onetone_option('left_sidebar_blog_archive','');
$right_sidebar  = onetone_option('right_sidebar_blog_archive','');
$aside          = 'no-aside';
if( $left_sidebar !='' )
$aside          = 'left-aside';
if( $right_sidebar !='' )
$aside          = 'right-aside';
if(  $left_sidebar !='' && $right_sidebar !='' )
$aside          = 'both-aside';
?>
<div class="post-wrap">
            <div class="container">
                <div class="post-inner row <?php echo $aside; ?>">
                    <div class="col-main">
                        <section class="post-main" role="main" id="content">                        
                            <article class="page type-page" id="" role="article">
                            <?php if (have_posts()) :?>
                                <!--blog list begin-->
                                <div class="blog-list-wrap">
                                
                                <?php while ( have_posts() ) : the_post();?>
                                <?php get_template_part("content",get_post_format()); ?>
                                <?php endwhile;?>
                                </div>
                                <?php endif;?>
                                <!--blog list end-->
                                <!--list pagination begin-->
                                <nav class="post-list-pagination" role="navigation">
                                    <?php if(function_exists("onetone_native_pagenavi")){onetone_native_pagenavi("echo",$wp_query);}?>
                                </nav>
                                <!--list pagination end-->
                            </article>
                            <div class="post-attributes"></div>
                        </section>
                    </div>
                    <?php if( $left_sidebar !='' ):?>
                    <div class="col-aside-left">
                        <aside class="blog-side left text-left">
                            <div class="widget-area">
                                <?php get_sidebar('archiveleft');?> 
                            </div>
                        </aside>
                    </div>
                    <?php endif; ?>
                    <?php if( $right_sidebar !='' ):?>
                    <div class="col-aside-right">
                       <?php get_sidebar('archiveright');?>
                    </div>
                    <?php endif; ?>
                    
                </div>
            </div>  
        </div>
<?php else: ?>
<div class="post-wrap">
  <div class="container-fullwidth">
    <div class="page-inner row no-aside" style="padding-top: 0; padding-bottom: 0;">
      <div class="col-main">
        <section class="post-main" role="main" id="content">
          <article class="page type-page homepage" id="" role="article">
            <?php
			global $onetone_options,$onetone_new_version,$onetone_homepage_sections ;
			$detect = new Mobile_Detect;
			$video_background_section  = onetone_option( 'video_background_section' );
			$video_background_type     = onetone_option( 'video_background_type' );
            $video_background_type     = $video_background_type == ""?"youtube":$video_background_type;
			$section_1_content         = onetone_option( 'section_1_content' );
			$animated                  = onetone_option( 'home_animated');
			$section_1_content   = $section_1_content=='slider'?1:$section_1_content;
			if( $animated == '1' )
			$onetone_animated = 'onetone-animated';
			
			$sections_num = 15 ;
			
            $new_homepage_section = array();
			for($i=0;$i<$sections_num;$i++){
			$section = onetone_option('section_order_'.$i);
			if( is_numeric($section ) )
			$new_homepage_section[] = $section;
			else
			$new_homepage_section[] = $i;
			}
			$i = 0 ;
			
			foreach( $new_homepage_section as $section_part ):
			$hide_section  = onetone_option( 'section_hide_'.($section_part-1) );
			
			if( $hide_section != '1' ){
			if( $section_part == 1 && $section_1_content == '1'){
				get_template_part('home-sections/section','slider');
				}else{
			//if( $video_background_section >0 && $video_background_section == $section_part && !$detect->isMobile() && !$detect->isTablet() )
			if( $video_background_section >0 && $video_background_section == $section_part  )
			get_template_part('home-sections/section',$video_background_type.'-video');
			else
			get_template_part('home-sections/section',$section_part);
			}
			
			}
			$i++;
			endforeach;
			?>
            <div class="clear"></div>
          </article>
        </section>
      </div>
    </div>
  </div>
</div>
<?php endif;?>
<?php get_footer();?><file_sep>/includes/shortcodes.php
<?php
/**
	 * Shortcodes
	 *
	 */
	 
	 //
	 
  global $onetone_shortcodes , $portfolio_categories;
	  
 function onetone_get_nav_array(){
	 $menus = get_terms('nav_menu');
	 $items = array();
		  foreach($menus as $menu){
			$items[$menu->term_id] = $menu->name;
		  } 
	 return $items;
	 }
	 
	 
 function onetone_get_post_categories(){
	  $post_categories = array();
 $post_type_array      = array();
 $args = array( 'hide_empty=0' );
 $terms = get_terms('category', $args);
 $post_categories[""] = "All";
 $count = count($terms); $i=0;
	if ($count > 0) {
		foreach ($terms as $term) {
			$i++;
			if(isset($term->slug) && isset($term->name)){
			$post_categories[$term->slug] = $term->name;
			}
		}
	}
	return $post_categories;
	 }

 //
 
 $portfolio_categories = array();
 $post_type_array      = array();
 $args = array( 'hide_empty'=>0,'post_type' => 'portfolio','posts_per_page' => -1 );
 $terms = get_terms('portfolio-category', $args);
 $portfolio_categories[""] = "All";
 $count = count($terms); $i=0;
	if ($count > 0) {
		foreach ($terms as $term) {
			$i++;
			if(isset($term->slug) && isset($term->name)){
			$portfolio_categories[$term->slug] = $term->name;
			}
		}
	}
	 
 $onetone_shortcodes = array(
	 'align' => array(
  array("type"=>"select","std"=>"left","id"=>"align","title"=>__("Align",'onetone') ,"desc"=>'',"options"=>array("left"=>"left","right"=>"right","center"=>"center")), 
  array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone')),
  array("type"=>"textarea","std"=>" Your Content ","id"=>"text_content","title"=>__("Content",'onetone') ,"desc"=>'')
  ) ,
  'animation' => array(
 array("type"=>"select","std"=>"1.5","id"=>"animation_speed","title"=>__("Animation Speed",'onetone') ,"desc"=>'',"options"=>array("0.1"=>"0.1","0.2"=>"0.2","0.3"=>"0.3","0.4"=>"0.4","0.5"=>"0.5","0.6"=>"0.6","0.7"=>"0.7","0.8"=>"0.8","0.9"=>"0.9","1"=>"1","1.2"=>"1.2","1.4"=>"1.4","1.6"=>"1.6","1.8"=>"1.8","2"=>"2","2.4"=>"2.4","2.6"=>"2.6","2.8"=>"2.8","3"=>"3")), 
  array("type"=>"select","std"=>"bounce","id"=>"animation_type","title"=>__("Animation Type",'onetone') ,"desc"=>'',"options"=>array("flash"=>"flash","shake"=>"shake","bounce"=>"bounce","scale"=>"scale","smush"=>"smush","spin"=>"spin","fade"=>"fade","fade-left"=>"fade-left","fade-right"=>"fade-right","fade-up"=>"fade-up","fade-down"=>"fade-down","slide-left"=>"slide-left","slide-right"=>"slide-right","slide-up"=>"slide-up","slide-down"=>"slide-down")),
  array("type"=>"select","std"=>"no","id"=>"image_animation","title"=>__("Image Animation",'onetone') ,"desc"=>__('Image animation only','onetone'),"options"=>array("no"=>"no","yes"=>"yes")),
  array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone')),
  array("type"=>"textarea","std"=>" Your Content ","id"=>"text_content","title"=>__("Content",'onetone') ,"desc"=>'')
  ),
  'button' => array(
	 array("type"=>"select","std"=>"normal","id"=>"size","title"=>__("Size",'onetone') ,"desc"=>'',"options"=>array("normal"=>"normal","large"=>"large")),
	 array("type"=>"select","std"=>"no","id"=>"rounded","title"=>__("Rounded",'onetone') ,"desc"=>'',"options"=>array("no"=>"no","yes"=>"yes")),
	 array("type"=>"text","std"=>"#","id"=>"link","title"=>__("Button Link",'onetone') ,"desc"=>''),
	  array("type"=>"select","std"=>"_blank","id"=>"target","title"=>__("Target",'onetone') ,"desc"=>'',"options"=>array("_blank"=>"_blank","_self"=>"_self","_parent"=>"_parent","_top"=>"_top")),
	  array("type"=>"text","std"=>"#666","id"=>"color","title"=>__("Color",'onetone') ,"desc"=>''),
	  
	 array("type"=>"textarea","std"=>" Button ","id"=>"text_content","title"=>__("Button Text",'onetone') ,"desc"=>''),	
     	
	array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone'))	
	
	
  ),	 
  'boxed'  => array(
	// array("type"=>"text","std"=>"","id"=>"width","title"=>__("Box Width",'onetone') ,"desc"=>__('Default 1170','onetone')),
     array("type"=>"textarea","std"=>" Your Content ","id"=>"text_content","title"=>__("Content",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone'))
  ),				   
  'column' => array(
   array("type"=>"select","std"=>"","id"=>"col_xs","title"=>__("Extra small grid( &lt; 768px)",'onetone') ,"desc"=>__("Select column width. This width will be calculated depend page width.",'onetone'),"options"=>array(""=>"default","1"=>"1/12","2"=>"2/12","3"=>"3/12","4"=>"4/12","5"=>"5/12","6"=>"6/12","7"=>"7/12","8"=>"8/12","9"=>"9/12","10"=>"10/12","11"=>"11/12","12"=>"12/12")),
  array("type"=>"select","std"=>"6","id"=>"col_sm","title"=>__("Small grid(&ge;  768px)",'onetone')  ,"desc"=>'',"options"=>array("1"=>"1/12","2"=>"2/12","3"=>"3/12","4"=>"4/12","5"=>"5/12","6"=>"6/12","7"=>"7/12","8"=>"8/12","9"=>"9/12","10"=>"10/12","11"=>"11/12","12"=>"12/12")),
    array("type"=>"select","std"=>"3","id"=>"col_md","title"=>__("Medium grid( &ge;  992px)",'onetone'),"desc"=>'',"options"=>array("1"=>"1/12","2"=>"2/12","3"=>"3/12","4"=>"4/12","5"=>"5/12","6"=>"6/12","7"=>"7/12","8"=>"8/12","9"=>"9/12","10"=>"10/12","11"=>"11/12","12"=>"12/12")),
    array("type"=>"select","std"=>"","id"=>"col_lg","title"=>__("Large grid( &ge;  1200px)",'onetone') ,"desc"=>'',"options"=>array(""=>"default","1"=>"1/12","2"=>"2/12","3"=>"3/12","4"=>"4/12","5"=>"5/12","6"=>"6/12","7"=>"7/12","8"=>"8/12","9"=>"9/12","10"=>"10/12","11"=>"11/12","12"=>"12/12")),
	array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone')),
	array("type"=>"textarea","std"=>" Your Content ","id"=>"text_content","title"=>__("Content",'onetone') ,"desc"=>'')
	),
   'divider'  => array(
	 array("type"=>"select","std"=>"","id"=>"style","title"=>__("Style",'onetone') ,"options"=>array(""=>"blank","1"=>"1","2"=>"2","3"=>"3","4"=>"4")),
	 array("type"=>"text","std"=>"20","id"=>"height","title"=>__("Divider Height",'onetone') ,"desc"=>'px'),
	 array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone'))
  )
   , 
  
	'menu' => array(
					
		array("type"=>"select","std"=>"","id"=>"item","title"=>__("Menu",'onetone') ,"options"=>onetone_get_nav_array()) ,
		array("type"=>"select","std"=>"static","id"=>"position","title"=>__("Position",'onetone') ,"options"=>array("static"=>"static","fixed"=>"fixed")),
		array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone'))			
		),
	
	
	 'contact'  => array(
	array("type"=>"select","std"=>"3","id"=>"style","title"=>__("Style",'onetone') ,"options"=>array("1"=>"1","2"=>"2","3"=>"3")),
	array("type"=>"text","std"=>get_option( 'admin_email' ),"id"=>"email","title"=>__("Contact Email",'onetone') ,"desc"=>''),
	 array("type"=>"textarea","std"=>"\n[form_field type='input' name='YOUR NAME' required='1'  options='']\n
[form_field type='input' is_email='1' name='YOUR EMAIL' required='1'  options='']\n
[form_field type='input' name='SUBJECT' required='1'  options='']\n
[form_field type='select' name='QUESTION TYPE' required='1'  options='Type Item One,Type Item Two,Type Item Three']\n
[form_field type='textarea' name='MESSAGE' required='1'  options='']\n","id"=>"text_content","title"=>__("List Items",'onetone') ,"desc"=>''),
	 
	array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone'))
	 
  ), 
	 
 'portfolio'  => array(
	array("type"=>"text","std"=>"4","id"=>"num","title"=>__("List Num",'onetone') ,"desc"=>''),
	array("type"=>"select","std"=>"4","id"=>"columns","title"=>__("Columns",'onetone') ,"options"=>array("2"=>"2","3"=>"3","4"=>"4")),
	array("type"=>"select","std"=>"","id"=>"category","title"=>__("Category",'onetone') ,"options"=>$portfolio_categories),
	array("type"=>"select","std"=>"0","id"=>"pagenav","title"=>__("Display Pagenav",'onetone') ,"options"=>array("0"=>"no","1"=>"yes")),
	array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone'))
	 
  ),
	  'pricing'  => array(
	 array("type"=>"select","std"=>"1","id"=>"style","title"=>__("Style",'onetone') ,"options"=>array("1"=>"1","2"=>"2")),  
	 array("type"=>"text","std"=>"$","id"=>"currency","title"=>__("Currency",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"29","id"=>"price","title"=>__("Price",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"","id"=>"title","title"=>__("Title",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"","id"=>"sub_title","title"=>__("Sub-title",'onetone') ,"desc"=>''),
	 array("type"=>"select","std"=>"0","id"=>"featured","title"=>__("Featured",'onetone') ,"options"=>array("0"=>"no","1"=>"yes")),
	 array("type"=>"text","std"=>"","id"=>"btn_text","title"=>__("Button Text",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"#","id"=>"btn_link","title"=>__("Button Link",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"fa-shopping-cart","id"=>"btn_icon","title"=>__("Button Icon",'onetone') ,"desc"=>__('Font Awesome Icon.','onetone')),
	 array("type"=>"textarea","std"=>"[pricing_item]5 GB Bandwidth[/pricing_item]\n[pricing_item]1 GB[/pricing_item]\n[pricing_item]8 GB Storage[/pricing_item]\n[pricing_item]Limited[/pricing_item]\n[pricing_item]2 Projects[/pricing_item]\n","id"=>"text_content","title"=>__("List Items",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone'))
  )
	 ,
'pricing_item'  => array(
	array("type"=>"textarea","std"=>"","id"=>"text_content","title"=>__("Content",'magee') ,"desc"=>'')
	 
  ),
	 
  'row'  => array(
	 array("type"=>"textarea","std"=>" Your Content ","id"=>"text_content","title"=>__("Content",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone'))
  ),
  
   'section'  => array(
	 array("type"=>"text","std"=>"#ffffff","id"=>"background_color","title"=>__("Section Background Color",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"","id"=>"background_image","title"=>__("Section Background Image",'onetone') ,"desc"=>''),
	 array("type"=>"select","std"=>"","id"=>"background_repeat","title"=>__("Background Repeat",'onetone') ,"options"=>array("repeat"=>"repeat all","no-repeat"=>"no-repeat","repeat-x"=>"repeat-x","repeat-y"=>"repeat-y")),
	 array("type"=>"select","std"=>"off","id"=>"background_size","title"=>__("100% Background Image",'onetone') ,"options"=>array("off"=>"off","on"=>"on")),
	 array("type"=>"select","std"=>"","id"=>"parallax","title"=>__("Parallax Scrolling Background Image",'onetone') ,"options"=>array("off"=>"off","on"=>"on")),
	 array("type"=>"text","std"=>"","id"=>"heading_color","title"=>__("Heading Font Color",'onetone') ,"desc"=>__('h1-h6 color, e.g. #ffffff','onetone')),
	 array("type"=>"text","std"=>"","id"=>"color","title"=>__("Font Color",'onetone') ,"desc"=>'e.g. #ffffff'),
	 array("type"=>"text","std"=>"","id"=>"padding","title"=>__("Section Padding",'onetone') ,"desc"=>__('e.g. 60px 0','onetone')),
     array("type"=>"textarea","std"=>" Your Content ","id"=>"text_content","title"=>__("Content",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"","id"=>"id","title"=>__("ID",'onetone') ,"desc"=>__('Scrolling to a specified target.','onetone')),
	 array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone'))
  )
   ,
     'team'  => array(
	 array("type"=>"select","std"=>"1","id"=>"style","title"=>__("Style",'onetone') ,"options"=>array("1"=>"1","2"=>"2","3"=>"3")),  
	 array("type"=>"text","std"=>"","id"=>"name","title"=>__("Member Name",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"","id"=>"byline","title"=>__("Byline",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"","id"=>"avatar","title"=>__("Avatar",'onetone') ,"desc"=>__('Size 238 x 271 px for 3/12 column','onetone')),
	 array("type"=>"select","std"=>"","id"=>"social_icon_1","title"=>__("Social Icon 1",'onetone') ,"options"=>
																		array("skype"=>"skype","facebook"=>"facebook","twitter"=>"twitter","google-plus"=>"google+","youtube"=>"youtube","linkedin"=>"linkedin","pinterest"=>"pinterest","email"=>"email","instagram"=>"instagram","deviantart"=>"deviantart","soundcloud"=>"soundcloud","vimeo"=>"vimeo","flickr"=>"flickr")),
	 array("type"=>"text","std"=>"","id"=>"social_link_1","title"=>__("Social Link 1",'onetone') ,"desc"=>''),
	 array("type"=>"select","std"=>"","id"=>"social_icon_2","title"=>__("Social Icon 2",'onetone') ,"options"=>array("skype"=>"skype","facebook"=>"facebook","twitter"=>"twitter","google-plus"=>"google+","youtube"=>"youtube","linkedin"=>"linkedin","pinterest"=>"pinterest","email"=>"email","instagram"=>"instagram","deviantart"=>"deviantart","soundcloud"=>"soundcloud","vimeo"=>"vimeo","flickr"=>"flickr")),
	 array("type"=>"text","std"=>"","id"=>"social_link_2","title"=>__("Social Link 2",'onetone') ,"desc"=>''),
	 array("type"=>"select","std"=>"","id"=>"social_icon_3","title"=>__("Social Icon 3",'onetone') ,"options"=>array("skype"=>"skype","facebook"=>"facebook","twitter"=>"twitter","google-plus"=>"google+","youtube"=>"youtube","linkedin"=>"linkedin","pinterest"=>"pinterest","email"=>"email","instagram"=>"instagram","deviantart"=>"deviantart","soundcloud"=>"soundcloud","vimeo"=>"vimeo","flickr"=>"flickr")),
	 array("type"=>"text","std"=>"","id"=>"social_link_3","title"=>__("Social Link 3",'onetone') ,"desc"=>''),
	 array("type"=>"select","std"=>"","id"=>"social_icon_4","title"=>__("Social Icon 4",'onetone') ,"options"=>array("skype"=>"skype","facebook"=>"facebook","twitter"=>"twitter","google-plus"=>"google+","youtube"=>"youtube","linkedin"=>"linkedin","pinterest"=>"pinterest","email"=>"email","instagram"=>"instagram","deviantart"=>"deviantart","soundcloud"=>"soundcloud","vimeo"=>"vimeo","flickr"=>"flickr")),
	 array("type"=>"text","std"=>"","id"=>"social_link_4","title"=>__("Social Link 4",'onetone') ,"desc"=>''),
	 array("type"=>"textarea","std"=>" Your Content ","id"=>"text_content","title"=>__("Description",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone'))
  ),
	 
  'service'  => array(
	 array("type"=>"select","std"=>"","id"=>"style","title"=>__("Style",'onetone') ,"options"=>array("1"=>"1","2"=>"2","3"=>"3","4"=>"4")),
     array("type"=>"text","std"=>"Our Service","id"=>"title","title"=>__("Title",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"fa-gift","id"=>"icon","title"=>__("Icon",'onetone') ,"desc"=>__('Font Awesome Icon or Image URL','onetone')),
	 //array("type"=>"text","std"=>"","id"=>"icon_color","title"=>__("Icon Color",'onetone') ,"desc"=>'e.g. #00b7ee'),
	 array("type"=>"text","std"=>"#","id"=>"link","title"=>__("Link",'onetone') ,"desc"=>__('Read more link.','onetone')),
	 array("type"=>"textarea","std"=>" Your Content ","id"=>"text_content","title"=>__("Content",'onetone') ,"desc"=>''),
	 array("type"=>"text","std"=>"","id"=>"css_class","title"=>__("Css Class",'onetone') ,"desc"=>__('Extra CSS class','onetone'))
  ),
 
  'timeline'  => array(
	array("type"=>"text","std"=>"3","id"=>"num","title"=>__("Blog List Num",'onetone') ,"desc"=>''),
	array("type"=>"select","std"=>"","id"=>"category","title"=>__("Category",'onetone') ,"options"=>onetone_get_post_categories()),
	array("type"=>"text","std"=>"60","id"=>"excerpt_length","title"=>__("Excerpt Length",'onetone') ,"desc"=>__('Number of words.','onetone'))
	 
  )
  
	);
	
	
	foreach($onetone_shortcodes as $onetone_shortcode => $std){
  add_shortcode($onetone_shortcode,'onetone_'.$onetone_shortcode.'_shortcode');
}


		  
/**
	 * Shortcode: align
	 *
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */ 
	 function onetone_align_shortcode($atts,$content=NULL){
	 extract( shortcode_atts( array(
	  'align' =>'left',
	  'css_class'   => ''
	  ), $atts ) );
	  $return = '<div class="onetone-shortcode align-'.$align.' '.$css_class.'" style="width:100%;">'.do_shortcode(onetone_fix_shortcodes( $content) ).'</div>';
	 
	 return $return;
	 }
	 
	  /**
	 * Shortcode: css animation
	 *
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */ 
	 function onetone_animation_shortcode($atts,$content=NULL){
	 extract( shortcode_atts( array(
	  'css_class'   => '',
	  'animation_speed' => '0.5',
	  'animation_type' => 'bounce',
	  'image_animation' =>'no'
	  ), $atts ) );
	 
	 $animation = 'data-animationduration="'.$animation_speed.'" data-animationtype="'.$animation_type.'" data-imageanimation="'.$image_animation.'"';
	 
	  $return = '<div class="animated '.$css_class.'" '.$animation.'>'.do_shortcode(onetone_fix_shortcodes( $content) ).'</div>';
	 
	 return $return;
	 }
	 
/**
	 * Shortcode: button
	 *
	 * @param string $content
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */
 function onetone_button_shortcode($atts,$content=NULL){
   extract( shortcode_atts( array(
  'css_class'   => '',
  'size' => '',
  'rounded' =>'',
  'link' => '#',
  'target' => '_blank',
  'color' => '#666'
  ), $atts ) );
   
   $css_style = "";
 if( $size == "large" ){
	 $css_class .= " btn-lg";
	 }
 if( $rounded == "yes" ){
	 $css_class .= " btn-rd";
	 }
  if( $color != "" ){
	  $css_style .= 'color:'.$color.';border-color:'.$color.';';
	  }
 $return = '<a  href="'.$link.'" target="'.$target.'" ><button class="onetone-shortcode btn '.$css_class.'" style="'.$css_style.'">'.do_shortcode( onetone_fix_shortcodes( $content ) ).'</button></a>';
							
	 return $return ;	
							
 }
 
 /**
	 * Shortcode: boxed
	 *
	 * @param string $content
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */
 function onetone_boxed_shortcode($atts,$content=NULL){
   extract( shortcode_atts( array(
  'css_class'   => '',
  'width'=> ''
  ), $atts ) );
 if($width != ""){
	 if(is_numeric($width))
	 $width = $width."px";
	 
	 $width = "width:".$width.";";
	 }
 $return = '<div class="onetone-shortcode  container '.$css_class.'" style="'.$width.'">'.do_shortcode( onetone_fix_shortcodes( $content ) ).'</div>';
							
	 return $return ;	
							
 }
 
	 
/**
	 * Shortcode: column
	 *
	 * @param string $content
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */
 function onetone_column_shortcode($atts,$content=NULL){
   extract( shortcode_atts( array(
  'col_xs' => '',
  'col_sm' => '',
  'col_md' => '',
  'col_lg' => '',
  
  'col_sm_offset' =>'', 
  'col_md_offset' =>'', 
  'col_lg_offset' =>'', 
  
  'col_sm_push' =>'', 
  'col_md_push' =>'', 
  'col_lg_push' =>'', 
  
  'col_sm_pull' =>'', 
  'col_md_pull' =>'', 
  'col_lg_pull' =>'',
  'css_class'   =>''

  ), $atts ) );
  
  $col_class = "";
  if(trim($col_xs) != "" && is_numeric($col_xs)){  $col_class .= "col-xs-".$col_xs." ";}
  if(trim($col_sm) != "" && is_numeric($col_sm)){  $col_class .= "col-sm-".$col_sm." ";}
  if(trim($col_md) != "" && is_numeric($col_md)){  $col_class .= "col-md-".$col_md." ";}
  if(trim($col_lg) != "" && is_numeric($col_lg)){  $col_class .= "col-lg-".$col_lg." ";}
  
  if(trim($col_sm_offset) != "" && is_numeric($col_sm_offset)){  $col_class .= "col-sm-offset-".$col_sm_offset." ";}
  if(trim($col_md_offset) != "" && is_numeric($col_md_offset)){  $col_class .= "col-md-offset-".$col_md_offset." ";}
  if(trim($col_lg_offset) != "" && is_numeric($col_lg_offset)){  $col_class .= "col-lg-offset-".$col_lg_offset." ";}
  
  if(trim($col_sm_push) != "" && is_numeric($col_sm_push)){  $col_class .= "col-sm-push-".$col_sm_push." ";}
  if(trim($col_md_push) != "" && is_numeric($col_md_push)){  $col_class .= "col-md-push-".$col_md_push." ";}
  if(trim($col_lg_push) != "" && is_numeric($col_lg_push)){  $col_class .= "col-lg-push-".$col_lg_push." ";}
  
  if(trim($col_sm_pull) != "" && is_numeric($col_sm_pull)){  $col_class .= "col-sm-pull-".$col_sm_pull." ";}
  if(trim($col_md_pull) != "" && is_numeric($col_md_pull)){  $col_class .= "col-md-pull-".$col_md_pull." ";}
  if(trim($col_lg_pull) != "" && is_numeric($col_lg_pull)){  $col_class .= "col-lg-pull-".$col_lg_pull." ";}
  
  if(trim($css_class) != ""){  $col_class .= $css_class;}
  
  $return  = '<div class="onetone-shortcode '.$col_class.'">';
  $return .= do_shortcode(onetone_fix_shortcodes( $content) );
  $return .= '<div class="clear"></div>';
  $return .= '</div>';
  return $return ;
 }
 
  /**
	 * Shortcode: Contact Form
	 *
	 * @param string $content
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */
 function onetone_form_field_shortcode( $atts,$content=NULL ){
	  extract( shortcode_atts( array(
      'type'   => 'input',
      'name'=> '',
	  'required'=>'',
	  'is_email' =>'',
	  'options' =>''
  ), $atts ) );
	  $inupt_type = 'text';
	  if($is_email == '1' || $is_email == 'yes' || $is_email == 'true' )
	  $inupt_type = 'email';
	  $return = "";
	  $required_str = "";
	  if($required == '1' || $required == 'yes' || $required == 'true' )
		   $required_str = ' required="required" aria-required="true" data-required="1" ';
		  
	  if( $name != "" ){ 
	  $field_id = sanitize_title( $name );
	  switch($type){
		  case "select":
		  $options_array = explode(",",$options);
		  $return .= '<section><select class="'.$field_id.'" '.$required_str.' data-name="'.$name.'" name="'.$field_id.'" id="'.$field_id.'">';
		  
		  $return .= '<option value="">=='.$name.'==</option>';
		  
		  foreach( $options_array as $option )
		  {
		 $return .= '<option value="'.$option.'">'.$option.'</option>';
			  }
		 $return .= '</select></section>'; 
		  break;
		  case "textarea":
		 $return .= '<section><textarea name="'.$field_id.'" data-name="'.$name.'"  '.$required_str.' id="'.$field_id.'" cols="39" rows="5" tabindex="3" placeholder="'.$name.'"></textarea></section>';
		  break;
		  case "input":
		  default:
		  $return .= '<section><input type="'.$inupt_type.'" name="'.$field_id.'" data-name="'.$name.'" value="" id="'.$field_id.'" placeholder="'.$name.'" tabindex="1" '.$required_str.'></section>';
         break;
		  
		  }
	  }
	  return $return;
	 
	 }
	 
	 add_shortcode('form_field','onetone_form_field_shortcode');
	  
 function onetone_contact_shortcode($atts,$content=NULL){
   extract( shortcode_atts( array(
  'css_class'   => '',
  'email'=> get_option( 'admin_email' ),
  'style' => '1'
  ), $atts ) );
   $return = "";
   
   if( $content != NULL ){
	   
	    switch($style){
	  case "1":
 $return = '<div class="onetone-shortcode contact-area '.$css_class.'"><form onsubmit="return false;" action="'.esc_url(home_url('/')).'" class="onetone-shortcode contact-form style1 " method="post">
                                                <fieldset>
                                                  '.do_shortcode( onetone_fix_shortcodes( $content ) ).'
                                                </fieldset>
                                                <section>
												<span class="noticefailed"></span>
												    <input type="hidden" name="sendto" id="sendto" value="'.base64_encode($email).'">
                                                    <input type="button" id="submit" name="submit" value="'.__("SEND","onetone").'" class="contact-submit btn-normal">
													<input type="hidden" name="contact-form-ver" class="contact-form-ver" value="2">
													<input type="hidden" name="email_error" value="'.__("Please enter valid email.",'onetone').'">
													<input type="hidden" name="name_error" value="'.__("Please enter your name.",'onetone').'">
													<input type="hidden" name="message_error" value="'.__("Message is required.",'onetone').'">
													
                                                </section>
                                            </form></div>';
 break;
 case "2":
 default:

 $return = '<div class="onetone-shortcode contact-area '.$css_class.'"><form onsubmit="return false;" action="'.esc_url(home_url('/')).'" class="onetone-shortcode contact-form style2 " method="post">
                                                <fieldset>
                                                 '.do_shortcode( onetone_fix_shortcodes( $content ) ).'
                                                </fieldset>
                                                <section>
												<span class="noticefailed"></span>
												    <input type="hidden" name="sendto" id="sendto" value="'.base64_encode($email).'">
                                                    <input type="button" id="submit" name="submit" value="'.__("SEND","onetone").'" class="contact-submit btn-normal">
													<input type="hidden" name="contact-form-ver" class="contact-form-ver" value="2">
													<input type="hidden" name="email_error" value="'.__("Please enter valid email.",'onetone').'">
													<input type="hidden" name="name_error" value="'.__("Please enter your name.",'onetone').'">
													<input type="hidden" name="message_error" value="'.__("Message is required.",'onetone').'">
                                                </section>
                                            </form></div>';
											break;
											case 3:
$return = '<div class="onetone-shortcode contact-area '.$css_class.'"><form action="'.esc_url(home_url('/')).'" method="post" class="onetone-shortcode contact-form style3 ">
<fieldset>
			   '.do_shortcode( onetone_fix_shortcodes( $content ) ).'
			   </fieldset>
			   <p class="noticefailed"></p>
			   <input type="hidden" value="'.base64_encode($email).'" id="sendto" name="sendto">
			   <input type="button" value="'.__("SEND","onetone").'" id="submit" name="submit">
			   <input type="hidden" name="contact-form-ver" class="contact-form-ver" value="2">
			   <input type="hidden" name="email_error" value="'.__("Please enter valid email.",'onetone').'">
													<input type="hidden" name="name_error" value="'.__("Please enter your name.",'onetone').'">
													<input type="hidden" name="message_error" value="'.__("Message is required.",'onetone').'">
			  </form></div>';
           break;
  }
	    return $return ;	
	   
	   }
 
     switch($style){
	  case "1":
 $return = '<div class="onetone-shortcode contact-area '.$css_class.'"><form onsubmit="return false;" action="'.esc_url(home_url('/')).'" class="onetone-shortcode contact-form style1 " method="post">
                                                <fieldset>
                                                    <section>
                                                        
                                                        <input type="text" name="name" id="name" placeholder="'.__("YOUR NAME","onetone").'*" tabindex="1" required="required" aria-required="true">
                                                    </section>
                                                    <section>
                                                        
                                                        <input type="email" name="email" id="email" placeholder="'.__("YOUR E-MAIL","onetone").'*" tabindex="2" required="required" aria-required="true">
                                                    </section>
                                                    <section>
                                                        
                                                        <textarea name="message" aria-required="true" required="required" id="message" cols="39" rows="5" tabindex="3" placeholder="'.__("YOUR MESSAGE","onetone").'*"></textarea>
                                                    </section>
                                                </fieldset>
                                                <section>
												<span class="noticefailed"></span>
												    <input type="hidden" name="sendto" id="sendto" value="'.base64_encode($email).'">
                                                    <input type="button" id="submit" name="submit" value="'.__("SEND","onetone").'" class="contact-submit btn-normal">
													<input type="hidden" name="email_error" value="'.__("Please enter valid email.",'onetone').'">
													<input type="hidden" name="name_error" value="'.__("Please enter your name.",'onetone').'">
													<input type="hidden" name="message_error" value="'.__("Message is required.",'onetone').'">
                                                </section>
                                            </form></div>';
 break;
 case "2":
 default:

 $return = '<div class="onetone-shortcode contact-area '.$css_class.'"><form onsubmit="return false;" action="'.esc_url(home_url('/')).'" class="onetone-shortcode contact-form style2 " method="post">
                                                <fieldset>
                                                    <section>
                                                        
                                                        <i class="fa fa-user fa-fw"></i>
                                                        <input type="text" name="name" id="name" placeholder="'.__("Your Name","onetone").'" tabindex="1" required="required" aria-required="true">
                                                    </section>
                                                    <section>
                                                        
                                                        <i class="fa fa-envelope fa-fw"></i>
                                                        <input type="email" name="email" id="email" placeholder="'.__("Your Email","onetone").'" tabindex="2" required="required" aria-required="true">
                                                    </section>
                                                    <section>
                                                        
                                                        <textarea name="message" aria-required="true" required="required" id="message" cols="39" rows="5" tabindex="3" placeholder="'.__("Message","onetone").'"></textarea>
                                                    </section>
                                                </fieldset>
                                                <section>
												<span class="noticefailed"></span>
												    <input type="hidden" name="sendto" id="sendto" value="'.base64_encode($email).'">
                                                    <input type="button" id="submit" name="submit" value="'.__("SEND","onetone").'" class="contact-submit btn-normal">
													<input type="hidden" name="email_error" value="'.__("Please enter valid email.",'onetone').'">
													<input type="hidden" name="name_error" value="'.__("Please enter your name.",'onetone').'">
													<input type="hidden" name="message_error" value="'.__("Message is required.",'onetone').'">
                                                </section>
                                            </form></div>';
											break;
											case 3:
$return = '<div class="onetone-shortcode contact-area '.$css_class.'"><form action="'.esc_url(home_url('/')).'" method="post" class="onetone-shortcode contact-form style3 ">
<fieldset>
			   <input type="text" aria-required="true" required="required" tabindex="1" size="22" placeholder="'.__("Name","onetone").'" value="" id="name" name="name">
			   <input type="email" aria-required="true" required="required" tabindex="2" size="22" placeholder="'.__("Email","onetone").'" value="" id="email" name="email"> 
			   <textarea placeholder="'.__("Message","onetone").'" required="required" tabindex="4" rows="7" cols="39" id="message" name="message"></textarea>
			   </fieldset>
			   <p class="noticefailed"></p>
			   <input type="hidden" value="'.base64_encode($email).'" id="sendto" name="sendto">
			   <input type="button" value="'.__("SEND","onetone").'" id="submit" name="submit">
			   <input type="hidden" name="email_error" value="'.__("Please enter valid email.",'onetone').'">
													<input type="hidden" name="name_error" value="'.__("Please enter your name.",'onetone').'">
													<input type="hidden" name="message_error" value="'.__("Message is required.",'onetone').'">
			  </form></div>';
           break;
  }
	 return $return ;	
							
 }
 
 
 /**
	 * Shortcode: divider
	 *
	 * @param string $content
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */
 function onetone_divider_shortcode($atts,$content=NULL){
   extract( shortcode_atts( array(
  'css_class'   => '',
  'height'=> '10',
  'style' => ''
  ), $atts ) );
 if($height != ""){
	 if(is_numeric($height))
	 $height = $height."px";
	 $height = "margin-bottom:".$height.";";
	 }
 $return = '<div class="onetone-shortcode divider style'.$style.' '.$css_class.'" style='.$height.'></div>';
							
	 return $return ;	
							
 }
 
/**
	 * Shortcode: menu
	 *
	 * @param string $content
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */
 function onetone_menu_shortcode( $atts,$content=NULL ){
	 
	  extract( shortcode_atts( array(
	  'item' =>'',
	  'css_class'   => '',
	  'position' =>'static'
	  ), $atts ) );
    $css_style = 'position:'.$position.';';
    $return    = '<div class="onetone-shortcode onetone-nav '.$css_class.'" style="'.$css_style.'">';
	$return   .= wp_nav_menu( array( 'echo'=> false,'menu' => $item,'depth'=>0,'fallback_cb' =>false,'container'=>'' ,'items_wrap'=> '<ul class="shortcode-nav">%3$s</ul>') );
	$return   .= '</div>';
	return $return;
	 }
	 

 /**
	 * Shortcode: portfolio
	 *
	 * @param string $content
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */
 function onetone_portfolio_shortcode($atts,$content=NULL){
   extract( shortcode_atts( array(
  'css_class'   => '',
  'columns'=> '4',
  'num' => '4',
  'category' => '',
  'pagenav' =>''
  ), $atts ) );
   global $paged;
   
   if(!is_numeric($category)){
		$term      = get_term_by('name', $category, 'portfolio-category');
		}else{
		$term      = get_term_by('id', $category, 'portfolio-category');
		}
  $return = '<div class="onetone-shortcode portfolio-wrapper">';
  $items  = '';
  $term_slug = isset($term->slug)?$term->slug:"";
  if(!is_numeric($columns) || $columns<2 || $columns>4)
  $columns  = 4;
  $i        = 1;
  $col      = 12/$columns ;
  if(!$paged){$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;}
 
  $query = new WP_Query('post_type=portfolio&paged='.$paged.'&orderby=menu_order&post_status=publish&portfolio-category='.$term_slug.'&posts_per_page='.$num);
  
    if($query->have_posts() ):
	while ($query->have_posts() ) :
    $query->the_post();
	
	$postid            = get_the_ID();
	$permalink         = get_permalink();
	$title             = get_the_title();
	$image             = "";
	$thumb             = "";
	 if (has_post_thumbnail( $postid) ): 
	$thumb = get_the_post_thumbnail( $postid , "portfolio-grid-thumb" ); 
	$image = wp_get_attachment_image_src( get_post_thumbnail_id( $postid ), 'large' );
	$image = $image[0];
	endif;
	
	
	$tags = get_the_tags(get_the_ID());
	   $tags_list = '<ul>';
	   if(is_array($tags)){
	   foreach ( $tags as $tag ) {
		  $tag_link   = get_tag_link( $tag->term_id );
		  $tags_list .= "<li><a href='{$tag_link}' title='{$tag->name}' class='{$tag->slug}'>";
		  $tags_list .= "{$tag->name}</a></li>";
	   }
	   }
	  $tags_list .= '</ul>';

     
       $items  .=  '<div class="portfolio-col col-sm-6 col-md-'.$col.' '.$css_class.'"><div class="portfolio-box text-center">';
	   
  
	   $items  .=  '<a href="'.get_permalink().'">';
	   $items  .= $thumb;
	   $items  .=  '</a>'; 
					
	  $items  .=  '<div class="portfolio-box-title"><a href="'.$permalink.'"><h3>'.$title.'</h3></a>
	  									'.$tags_list.'
									</div>
								</div>
							</div>';
							
	
/* $items  .= '<div class="col-md-'.$col.' col-sm-6 '.$css_class.'">
 
 <figure class="portfolio-list-box">
								'. $thumb.'
								<figcaption>
									<a href="'.$permalink.'"><h3>'.$title.'</h3></a>
									'.get_the_excerpt().'
								</figcaption>
							</figure></div>';*/
	  if($i%$columns == 0) 
	  {  
	      $return .= '<div class="row">'. $items.'</div>';
		  $items  = '';
		  }
     $i++ ;
		endwhile;
		endif;
		if($items  != '') $return .= '<div class="row">'. $items.'</div>';
		
		if($pagenav == "yes" || $pagenav == "1"){	
		$return .= '<div class="list-pagition text-center">'.onetone_native_pagenavi("return",$query).'</div>';
		}
		$return .= '</div>';
		wp_reset_postdata();
	 return $return ;	
							
 }
 

  /**
	 * Shortcode: pricing
	 *
	 * @param string $content
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */
 function onetone_pricing_shortcode($atts,$content=NULL){
   extract( shortcode_atts( array(
  'css_class' => '',
  'currency' =>'$',
  'price' => '',
  'title' => '',
  'sub_title' => '',
  'color' => '',
  'btn_text' => 'BUY',
  'btn_link' => '#',
  'btn_icon' => 'fa-shopping-cart',
  'style'    => '1',
  'featured' => '0'
  ), $atts ) );
   $css_style = '';
  if($color !=""){
	  $css_style = 'background-color: '.$color.';color: #fff;border-color: '.$color.';';
  }
 $is_featured = "" ;
 if($featured == '1' || $featured == 'yes') $is_featured = " featured";
 $css_class  .= " style".$style;
 $css_class  .= $is_featured;
 switch($style){
	 
	 case "2":
	 $return = '<div class="onetone-shortcode price-box '.$css_class.'">
                                                <ul>
                                                    <li class="price-title">
                                                        <h3>'.$title.'</h3>
                                                        <div class="price-tag">
                                                            <sup>'.$currency.'</sup>'.$price.'
                                                        </div>
                                                        <h4>'.$sub_title.'</h4>
                                                    </li>
                                                    '.do_shortcode( onetone_fix_shortcodes($content) ).'
                                                    <li><a href="'.$btn_link.'" target="_blank"><button class="btn"><i class="fa '.$btn_icon.'"></i> '.$btn_text.'</button></a></li>
                                                </ul>
                                            </div>';
	 break;
	 case "1":
	 default:
 $return = '<div class="onetone-shortcode price-box '.$css_class.'">
								<div class="price-tag" style="'.$css_style.'">
									<sup>'.$currency.'</sup>'.$price.'
								</div>
								<ul>
									<li class="price-title">
										<h3>'.$title.'</h3>
										<h4>'.$sub_title.'</h4>
									</li>
									'.do_shortcode( onetone_fix_shortcodes($content) ).'
									<li><a href="'.$btn_link.'" target="_blank"><button class="btn" style="'.$css_style.'"><i class="fa '.$btn_icon.'"></i> '.$btn_text.'</button></a></li>
								</ul>
							</div>';
			break;				
     }
	 return $return ;	
							
 }
 
  function onetone_pricing_item_shortcode($atts,$content=NULL){
   extract( shortcode_atts( array(
  'css_class' => ''
  ), $atts ) );
   $return = '<li>'.do_shortcode( onetone_fix_shortcodes($content) ).'</li>';
   return $return ;
  }

/**
	 * Shortcode: row
	 *
	 * @param string $content
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */
  function onetone_row_shortcode($atts,$content=NULL)
  {
  
  extract( shortcode_atts( array(
  'css_class'   => '' 
  ), $atts ) );
  
  $return   = '<div class="onetone-shortcode row '.$css_class.'">';
  $return  .=  do_shortcode(onetone_fix_shortcodes( $content) );
  $return  .= '</div>'; 
  return $return ;
  }
  
   /**
	 * Shortcode: section
	 *
	 * @param string $content
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */
 function onetone_section_shortcode($atts,$content=NULL){
   extract( shortcode_atts( array(
  'css_class'   => '',
  'background_color' => '',
  'background_image' => '',
  'background_repeat' => '',
  'background_size' => 'off',
  'padding' =>'',
  'parallax' => 'off',
  'color' =>'',
  'heading_color'=>'',
  'id' => ''
  
  ), $atts ) );
 $style   = "";
 $bg_pos  = "";
 if( $parallax == "on" ){
 $css_class .= " onetone-parallax";
 }
 if($background_color != "")
 $style .= 'background-color:'.$background_color.';';
  if($background_image != "")
  {
	  if( $parallax == "on" )
    $style .= 'background:url('.$background_image.')  50% 0 no-repeat fixed;';
      else
    $style .= 'background-image:url('.$background_image.');';
  }
 if( $background_repeat != "" && $parallax != "on" )
 $style .= 'background-repeat:'.$background_repeat.' ;';
 if( $color != "" )
 $style .= 'color:'.$color.' ;';
 if( $background_size == "on" )
 $style .= '-webkit-background-size: cover;
			-moz-background-size: cover;
			-o-background-size: cover;
			background-size: cover;';
 
 if($padding != ""){
	  if(is_numeric($padding))
	 $padding = $padding."px";
	 
	 $style .= "padding:".$padding.";";
	 }
	 
	 
 
 $return = '<section id="'.$id.'" data-headingcolor="'.$heading_color.'" class="onetone-shortcode '.$css_class.'" style="'.$style.'">'.do_shortcode( onetone_fix_shortcodes($content) ).'<div class="clear"></div></section>';
							
	 return $return ;	
							
 }
  
  /**
	 * Shortcode: service
	 *
	 * @param string $content
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */
 function onetone_service_shortcode($atts,$content=NULL){
   extract( shortcode_atts( array(
  'css_class'   => '',
  'title' => '',
  'icon' => '',
  'link' => '',
  'icon_color'=>'',
  'style' => '1'
  ), $atts ) );
   if($icon_color != "")
   $icon_color = 'style="color:'.$icon_color.'"';
   $css_class .= ' style'.$style; 
   $more_link  = '';
   
	
   switch($style){
	   case "2":
	   case "4":
	   if($link != "")
      $more_link  = '<div class="text-right"><a href="'.esc_url($link).'" class="text-right">'.__("Read More","onetone").'&gt;&gt;</a></div>';
	  $return      = '<div class="onetone-shortcode  service-box '.$css_class.' text-left">';
	  
	   if(strstr($icon,"http")){
		  $return     .= '<h3><img src="'.$icon.'" alt="'.$title.'" />'.$title.'</h3>';
		}else{
		 $return      .= '<h3><i class="fa '.$icon.' '.$icon_color.'"></i>'.$title.'</h3>';
		}
	  
      $return     .= '<p>'.do_shortcode(onetone_fix_shortcodes( $content) ).'</p>'.$more_link.'</div>';
	   break;
	   
	  case "1":
	  case "3":
	  default:
   $return   = '<div class="onetone-shortcode  service-box text-center '.$css_class.'">';
   if($icon != ""){
	   
	   if(strstr($icon,"http")){
  $return .= '<img src="'.$icon.'" alt="'.$title.'" />';
  }else{
   $return  .= '<i class="fa '.$icon.'" '.$icon_color.'></i>';
  }
   
   }
   if($title != "")
   $return  .= '<h3>'.$title.'</h3>';
   $return  .= '<p>'.do_shortcode(onetone_fix_shortcodes( $content) ).'</p>';
   if($link != "")
   $return  .= '<a href="'.esc_url($link).'">'.__("Read More","onetone").'&gt;&gt;</a>';
   $return  .= '</div>';
   break;
    }
   
   
   return $return ;	  
 }
 
  /**
 * Shortcode: blog timeline
 *
 * @param array $atts Shortcode attributes
 * @return string Output html
 * author: quan
 */ 
 function onetone_timeline_shortcode($atts,$content=NULL){
	 extract( shortcode_atts( array(
	  'css_class'   => '',
	  'num' => '3',
      'category' => '',
	  'excerpt_length' => '60'
	  ), $atts ) );
	 
	  global $paged;
   $return = '<div class="onetone-shortcode timeline '.$css_class.'"><div class="time-stick"></div>';
   
   // $paged =(get_query_var('paged'))? get_query_var('paged'): 1;
    $wp_query = new WP_Query( 'showposts='.$num.'&category_name='.$category.'&post_status=publish&ignore_sticky_posts=1' );

	$i = 1 ;
	if ($wp_query -> have_posts()) :
    while ( $wp_query -> have_posts() ) : $wp_query -> the_post();

	$return .= '<div class="time-box">
      <a href="'.get_permalink().'"><h2 class="time-title">'.get_the_title().'</h2></a>
      <p class="time-content">'.onetone_cover_content( $excerpt_length,get_the_excerpt() ).'
      </p>             
    </div>';
									   
	endwhile;
	endif;
	
	$return .= '</div>';
	wp_reset_postdata();
	 
	 return $return;
	 }
	 
	 /**
	 * Shortcode: team
	 *
	 * @param string $content
	 * @param array $atts Shortcode attributes
	 * @return string Output html
	 * author: quan
	 */
 function onetone_team_shortcode($atts,$content=NULL){
   extract( shortcode_atts( array(
  'css_class'   => '',
   'name' => '',
   'avatar' => '',
   'byline'   => '',
   'social_icon_1'   => '',
   'social_link_1'   => '',
   'social_icon_2'   => '',
   'social_link_2'   => '',
   'social_icon_3'   => '',
   'social_link_3'   => '',
   'social_icon_4'   => '',
   'social_link_4'   => '',
   'style' => '1'
   
  ), $atts ) );

 $css_class .= " style".$style; 
 switch($style){
 case "2":
 $return = '<div class="onetone-shortcode team-box '.$css_class.'">
                                                <div class="team-img-box">
                                                    <img src="'.esc_url($avatar).'">
                                                </div>
                                                <div class="team-info">
                                                    <h4>'.$name.'</h4>
                                                    <h5>'.$byline.'</h5>
                                                    <p>'.do_shortcode( onetone_fix_shortcodes($content) ).'</p>
                                                    <div>
                                                        <div class="team-sns">';
                                                     	for($i = 1; $i<=4 ; $i++){
												if(${"social_icon_$i"} != "" && ${"social_link_$i"} != ""){
												$return .= '<a href="'.${"social_link_$i"}.'"><i class="fa fa-'.${"social_icon_$i"}.'"></i></a>';
												}
											}
      $return .= ' </div></div></div></div>';
 break;
 case "3":
 $return = '<div class="onetone-shortcode team-box '.$css_class.'">
                                                <div class="team-img-box">
                                                    <img src="'.esc_url($avatar).'">
                                                </div>
                                                <div class="team-info">
                                                    <h4>'.$name.'</h4>
                                                    <h5>'.$byline.'</h5>
                                                    <p>'.do_shortcode( onetone_fix_shortcodes($content) ).'</p>
                                                    <div>
                                                        <div class="team-sns">';
                                                         for($i = 1; $i<=4 ; $i++){
												if(${"social_icon_$i"} != "" && ${"social_link_$i"} != ""){
												$return .= '<a href="'.${"social_link_$i"}.'"><i class="fa fa-'.${"social_icon_$i"}.'"></i></a>';
												}
											}
  $return .= '</div>
                                                    </div>
                                                </div>                                                
                                            </div>';
 break ; 
 case "1":
 default:
 $return = '<div class="onetone-shortcode team-box '.$css_class.'">
								<div class="team-img-box">
									<img src="'.esc_url($avatar).'">
									<div class="team-info">
										<h4>'.$name.'</h4>
										<h5>'.$byline.'</h5>
										<img src="'.esc_url($avatar).'">
										<div>
											<div class="team-sns">';
											for($i = 1; $i<=4 ; $i++){
												if(${"social_icon_$i"} != "" && ${"social_link_$i"} != ""){
												$return .= '<a href="'.${"social_link_$i"}.'"><i class="fa fa-'.${"social_icon_$i"}.'"></i></a>';
												}
											}
												
	$return .= '</div>
         </div>  </div>
 </div><p>'.do_shortcode( onetone_fix_shortcodes($content) ).'</p></div>';
   break;
 }
							
	 return $return ;	
							
 }
	 
################################################
#
#      Onetone Shortcodes Generator
#
################################################

function onetone_form_generator($value){
	
		if(!isset($value['id'])){exit;}
		$value['std'] = isset($value['std'])?$value['std']:"";
			$value['std'] = str_replace("\r\n",' ', $value['std']);
	?>
		<div class="onetone-shortcode-attr-container">
			<label for="onetone-<?php echo $value['id']; ?>"><h5><?php  echo $value['title']; ?></h5></label>
		<?php
		switch ( $value['type'] ) {
		
			case 'text': ?>
				<input  name="<?php echo $value['id']; ?>" id="onetone-<?php  echo $value['id']; ?>" type="text" value="<?php echo $value['std']; ?>" />
			<?php 
			break;
	
			case 'checkbox':
				if($value['id']){$checked = "checked=\"checked\"";  $checkbox_switch = "on";} else{$checked = "";$checkbox_switch = "off";} ?>
				
					<input class="on-of" type="checkbox" name="onetone-<?php echo $value['id'] ?>" id="<?php echo $value['id'] ?>" value="true" <?php echo $checked; ?> />
			<?php	
			break;
			case 'radio':
			?>
				<div style="float:left; width: 295px;">
					<?php foreach ($value['options'] as $key => $option) { ?>
					<label style="display:block; margin-bottom:8px;"><input name="<?php echo $value['id']; ?>" id="onetone-<?php echo $value['id']; ?>" type="radio" value="<?php echo $key ?>" <?php if ( $value['id'] == $key) { echo ' checked="checked"' ; } ?>> <?php echo $option; ?></label>
					<?php } ?>
				</div>
			<?php
			break;
			
			case 'select':
			?>
				<select name="<?php echo $value['id']; ?>" id="onetone-<?php echo $value['id']; ?>">
					<?php foreach ($value['options'] as $key => $option) { ?>
					<option value="<?php echo $key ?>" <?php if (  $value['std'] == $key) { echo ' selected="selected"' ; } ?>><?php echo $option; ?></option>
					<?php } ?>
				</select>
			<?php
			break;
			
			case 'textarea':
			?>
				<textarea name="<?php echo $value['id']; ?>" id="onetone-<?php echo $value['id']; ?>" type="textarea" cols="100%" rows="8" tabindex="4"><?php echo $value['std'];  ?></textarea>
			<?php
			break;
	
			case 'upload':
			?>
		
			<input id="<?php echo $value['id']; ?>" class="img-path upload_box" type="text" size="56" style="direction:ltr; text-laign:left" name="<?php echo $value['id']; ?>" value="<?php echo $value['std']; ?>" />
					<input id="upload_<?php echo $value['id']; ?>_button" type="button" class="upload_image_button" value="Upload" />
					<?php
					if(isset($value['std']) && $value['std'] != ""){
					$img_preview = '<div id="'.$value['id'].'-preview" class="img-preview"><img src="'.$value['std'].'" alt="" /><a class="del-img" title="Delete"></a></div>';}
					?>
		
			<?php
			break;
			case 'color':
			?>
			<input type="text" value="<?php echo $value['std'] ; ?>" class="minicolors" data-theme="bootstrap" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" />					
			<?php
			break;
			}
			?>
			<?php if( isset( $value['desc'] ) ) : ?><div class="onetone-shortcode-attr-desc"><?php echo $value['desc'] ?></div><?php endif; ?>
		
			<div class="clear"></div>
		</div>
<?php
	}
	
/*	
	*	Shortcode  generator Form
	*	---------------------------------------------------------------------
	*/
	
 function onetone_shortcode_form(){
   global $onetone_shortcodes ;
   $shortcode = $_POST['shortcode'];
  if(isset($onetone_shortcodes[$shortcode]) && is_array($onetone_shortcodes[$shortcode])){
	foreach($onetone_shortcodes[$shortcode] as $key=>$value){
		if(is_array($value)){
		  array_push($value,array("id"=>$key));
		  onetone_form_generator($value);
		  }
	 }

 echo '<input type="hidden" id="onetone-curr-shortcode" value="'.$shortcode.'" />';
 echo '<div class="clear"></div>';

	}

	exit();
	}
	add_action('wp_ajax_onetone_shortcode_form', 'onetone_shortcode_form');
	add_action('wp_ajax_nopriv_onetone_shortcode_form', 'onetone_shortcode_form');

	/*	
	*	Shortcode Generator
	*	---------------------------------------------------------------------
	*/
	
 function onetone_get_shortcode(){
	global $onetone_shortcodes ;
	$attr      = isset($_POST['attr'])?$_POST['attr']:"";
	$shortcode = isset($_POST['shortcode'])?$_POST['shortcode']:"";
	$content   = "";
	$result    = "";
	$shortcodes_attr = array();

	if(is_array($attr) && $attr != null && array_key_exists( $shortcode,$onetone_shortcodes))
	{
	foreach($onetone_shortcodes[$shortcode] as $key=>$value){
	$shortcodes_attr[] = $value['id'];
	}
	$result = '['.$shortcode.' ';
	  foreach($attr as $k=>$v){
	  if($v["name"] != "content" && $v["name"] != "text_content"){
	      if($v["value"] !="" && in_array($v["name"],$shortcodes_attr)){
	       $result .= $v["name"].'=\''.$v["value"].'\' ';
		   }
	    }
		else{
		   $content = $v["value"] . '[/'.$shortcode.']';
		}
	  }
	  $result .= ']';
	  $result .= $content ;
	}
	$result = stripslashes($result);
//	$result = str_replace("\r\n",' ', $result);
	echo $result; 
	exit();
	}
	
	add_action('wp_ajax_onetone_get_shortcode', 'onetone_get_shortcode');
	add_action('wp_ajax_nopriv_onetone_get_shortcode', 'onetone_get_shortcode');
	


//add a button to the content editor, next to the media button
//this button will show a popup that contains inline content
add_action('media_buttons_context', 'onetone_add_my_custom_button');

//add some content to the bottom of the page 
//This will be shown in the inline modal
if(is_admin()){
add_action('admin_footer', 'onetone_add_inline_popup_content');
}
//action to add a custom button to the content editor
function onetone_add_my_custom_button($context) {
  
  //path to my icon
  $img = get_template_directory_uri() .'/images/shortcode_button.png';
  
 
  //our popup's title
  $title = __('Onetone Shortcodes','onetone');

  //append the icon
  $context .= "<a class='onetone_shortcodes button' title='{$title}'><img style='margin-bottom:2px' src='{$img}' />".__('Onetone Shortcodes','onetone')."</a>";
  
  return $context;
}

function onetone_add_inline_popup_content() {
global $onetone_shortcodes ;

?>
<div class="white-popup onetone_shortcodes_container mfp-with-anim mfp-hide" id="onetone_shortcodes_container" style="display:none;" >
 <form>
  <h4><?php _e("Onetone Shortcodes Generator",'onetone');?></h4>
  <ul class="onetone_shortcodes_list">
  <?php if(is_array($onetone_shortcodes )):foreach($onetone_shortcodes as $key => $val){ 	
         if(in_array($key ,array("testimonial_item","pricing_item","testimonial",'tab','accordion'))){continue;}
  ?>
  
  <li><a class='onetone_shortcode_item <?php //echo $key;?>' title='<?php echo ucwords(str_replace("_"," ",$key));?>' data-shortcode="<?php echo $key;?>" href="javascript:;"><?php echo ucwords(str_replace("_"," ",$key));?></a></li>
  <?php } ?>
  <?php endif;?>
	  </ul>
	  <div id="onetone-shortcodes-settings">
	  
	 
  <div id="onetone-generator-breadcrumbs">
  <a title="Click to return to the shortcodes list" class="onetone-shortcodes-home" href="javascript:void(0);"><?php  _e("All shortcodes",'onetone');?></a>  &rarr; <span class="current_shortcode"></span>
    <div class="clear"></div>
  </div>
	        <div id="onetone-shortcodes-settings-inner"></div>
			<input name="onetone-shortcode" type="hidden" id="onetone-shortcode" value="" />
			<input name="onetone-shortcode-textarea" type="hidden" id="onetone-shortcode-textarea" value="" />
			<div class="onetone-shortcode-actions onetone-shortcode-clearfix">
			<!--<a class="button button-secondary button-large onetone-shortcode-preview "  href="javascript:void(0);"><?php _e("Preview shortcode",'onetone');?></a>-->
			<a class="button button-primary button-large onetone-shortcode-insert "  href="javascript:void(0);"><?php _e("Insert shortcode",'onetone');?></a>
			
	  </div>
	  <div class="clear"></div>
	  </div></form>
	  <div class="clear"></div>
</div>
<div id="onetone-shortcode-preview" style="display:none;">

</div>
<?php } 
	
################################################
#
#      End Onetone Shortcodes Generator
#
################################################<file_sep>/single-portfolio.php
<?php
/**
* The sigle template file.
*
*/
get_header(); 
$related_number = absint(onetone_option('related_number','8'));
   
$left_sidebar   = onetone_option('left_sidebar_portfolio_posts');
$right_sidebar  = onetone_option('right_sidebar_portfolio_posts');
$aside          = 'no-aside';
if( $left_sidebar !='' )
$aside          = 'left-aside';
if( $right_sidebar !='' )
$aside          = 'right-aside';
if(  $left_sidebar !='' && $right_sidebar !='' )
$aside          = 'both-aside';

?>
<div id="portfolio-<?php the_ID(); ?>" <?php post_class("clear"); ?>>
<section class="page-title-bar title-left no-subtitle" style="">
            <div class="container">
                <hgroup class="page-title">
                    <h1><?php the_title();?></h1>
                </hgroup>
                <?php onetone_get_breadcrumb(array("before"=>"<div class=''>","after"=>"</div>","show_browse"=>false,"separator"=>'','container'=>'div'));?> 
                <div class="clearfix"></div>            
            </div>
        </section>
<div class="post-wrap">
            <div class="container">
                <div class="post-inner row <?php echo $aside; ?>">
                    <div class="col-main">
                        <section class="post-main" role="main" id="content">
                         <?php if (have_posts()) :?>
						  <?php	
                          while ( have_posts() ) : the_post();
                          ?>
                            <article class="portfolio type-portfolio" id="">
                            
								<?php    
										  $galleryArray = get_post_gallery_ids( get_the_ID() ); 
										  
										  if( count( $galleryArray ) >0 && $galleryArray[0] != "" ):
									?>
      
                                <div class="post-slider">
                                    <!--slider-->
                                    <div id="portfolio-carousel" class="carousel slide" data-ride="carousel">
                                        <!-- Wrapper for slides -->
                                        <div class="carousel-inner" role="listbox" style=" ">
                                        
                                           <?php
										    $i = 0 ;
											 foreach ($galleryArray as $id) { 
											 ?>
                                            <div class="item <?php echo $i==0?'active':'';?>">
                                                <img src="<?php echo wp_get_attachment_url( $id ); ?>" alt="" />
                                            </div>
                                            <?php 
											$i++;
											}
											?>
                                        </div>
                                        <!-- Controls -->
                                        <div class="multi-carousel-nav style1 nav-bg">
                                            <a class="" href="#portfolio-carousel" role="button" data-slide="prev">
                                                <span class="multi-carousel-nav-prev"></span>
                                            </a>
                                            <a class="" href="#portfolio-carousel" role="button" data-slide="next">
                                                <span class="multi-carousel-nav-next"></span>
                                            </a>
                                        </div>
                                    </div>
                                    <!--slider end-->
                                </div>
                                <?php endif ; ?>
                                <div class="entry-main">
                                    <div class="entry-header">                                            
                                        <h1 class="entry-title"><?php the_title();?></h1>
                                    </div>
                                    <div class="entry-content">
                                        <?php the_content();?>
                                    </div>
                                    <div class="entry-footer">
  
                                        <?php

										$taxonomy = 'portfolio-tag';
										$tax_terms = wp_get_post_terms($post->ID,$taxonomy);
										
										if( $tax_terms ){?>
                                        <ul class="entry-tags no-border pull-left">
										<?php _e('Tags','onetone');?>: 
                                        <?php 
										foreach ($tax_terms as $tax_term) {
										echo '<li><a href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ,'onetone'), $tax_term->name ) . '" ' . '>' . $tax_term->name.'</a></li>';
										} ?>
										
										</ul>
										<?php 
										}
										?>
                                        
                                    </div>
                                </div>
                            </article>
                           <?php endwhile;?>
                            <?php endif;?>
                            <div class="post-attributes">
                                <!--Related Projects-->
                                
                          <?php 
								
								$related = onetone_get_related_posts($post->ID, $related_number,'portfolio','portfolio-category'); 
											  
									?>
			                        <?php if($related->have_posts()): 
									        $date_format = onetone_option('date_format','M d, Y');
											
									?>
            
                                    <div class="related-posts">
                                        <h3><?php _e( 'Related Project', 'onetone' );?></h3>
                                        <div id="related-portfolio" class="multi-carousel onetone-related-posts owl-carousel owl-theme">
                                        
                            <?php while($related->have_posts()): $related->the_post(); ?>
                            
							<?php if(has_post_thumbnail()): ?>
                            <?php  $full_image  = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); 
							        $thumb_image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'related-post');
							?>
                                            <div class="owl-item">
											<div class="portfolio-box">
                                                                <div class="feature-img-box">
                                                                    <div class="img-box figcaption-middle text-center from-top fade-in">
                                                                        <img src="<?php echo $thumb_image[0];?>" class="feature-img"/>
                                                                        <div class="img-overlay">
                                                                            <div class="img-overlay-container">
                                                                                <div class="img-overlay-content">
                                                                                    <div class="img-overlay-icons">
                                                                                       <a href="<?php the_permalink(); ?>"><i class="fa fa-link"></i></a>
                                                                                       <a rel="portfolio-image" href="<?php echo $full_image[0];?>"><i class="fa fa-search"></i></a>                                                                                    </div>         
                                                                                </div>
                                                                            </div>                                        
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="entry-main text-center">
                                                                    <div class="entry-header">
                                                                        <a href="<?php the_permalink(); ?>"><h1 class="entry-title"><?php the_title(); ?></h1></a>
                                                                    </div>
                                                                    <div class="entry-meta">
                                                                        <div class="entry-category">
														<?php
														$taxonomy = 'portfolio-tag';
														$tax_terms = wp_get_post_terms($post->ID,$taxonomy);
														$tags      = array();
														if( $tax_terms ){
														foreach ( $tax_terms as $tax_term ) {
														$tags[] = '<a href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ,'onetone'), $tax_term->name ) . '" ' . '>' . $tax_term->name.'</a>';
														}
														}
														$tags = implode(', ',$tags);
														echo $tags;
														?>
																		</div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                            
                                                            </div>
                                                            
                                            <?php endif; endwhile; ?>
                                        </div>
                                    </div>
                                    <?php wp_reset_postdata(); endif; ?>
                                <!--Related Posts End-->
                                <!--Comments Area-->                                
                                <div class="comments-area text-left"> 
                                     <?php
											// If comments are open or we have at least one comment, load up the comment template
											if ( comments_open()  ) :
												comments_template();
											endif;
										?>
                                     </div>
                                <!--Comments End-->

                                <?php echo onetone_post_nav();?>  

                            </div>
                            
                        </section>
                    </div>
                    <?php if( $left_sidebar !='' ):?>
                    <div class="col-aside-left">
                        <aside class="blog-side left text-left">
                             <?php get_sidebar('portfolioleft');?> 
                        </aside>
                    </div>
                    <?php endif; ?>
                    <?php if( $right_sidebar !='' ):?>
                    <div class="col-aside-right">
                        <?php get_sidebar('portfolioright');?>
                    </div>
                     <?php endif; ?>
                </div>
            </div>  
        </div>

</div>
<?php get_footer(); ?><file_sep>/home-sections/section-11.php
<?php
global $onetone_animated;
 $i                   = 10 ;
 $section_title       = onetone_option( 'section_title_'.$i );
 $section_menu        = onetone_option( 'menu_title_'.$i);
 $parallax_scrolling  = onetone_option( 'parallax_scrolling_'.$i );
 $section_css_class   = onetone_option( 'section_css_class_'.$i );
 $section_content     = onetone_option( 'section_content_'.$i );
 $full_width          = onetone_option( 'full_width_'.$i );
 
  $content_model       = onetone_option( 'section_content_model_'.$i,1);
 $section_subtitle    = onetone_option( 'section_subtitle_'.$i);
 $color               = onetone_option( 'section_color_'.$i );
	
  if( !isset($section_content) || $section_content=="" ) 
  $section_content = onetone_option( 'sction_content_'.$i );
  
  $section_id      = sanitize_title( onetone_option( 'menu_slug_'.$i ,'section-'.($i+1) ) );
  if( $section_id == '' )
   $section_id = 'section-'.($i+1);
   
   $section_id  = strtolower( $section_id );
  
  $container_class = "container";
  if( $full_width == "yes" ){
  $container_class = "";
  }
  
  if( $parallax_scrolling == "yes" || $parallax_scrolling == "1" ){
	 $section_css_class  .= ' onetone-parallax';
  }
  
?>
<section id="<?php echo $section_id; ?>" class="section home-section-<?php echo ($i+1); ?> <?php echo $section_css_class;?>">
    	<div class="home-container <?php echo $container_class; ?> page_container">
		<?php
		if( $content_model == '0' ):
		?>
        <div style="color:<?php echo $color; ?>;">
         <?php if( $section_title != '' ):?>
       <?php  
		   $section_title_class = '';
		   if( $section_subtitle == '' )
		   $section_title_class = 'no-subtitle';
		?>
       <h1 class="section-title <?php echo $section_title_class; ?>"><?php echo $section_title; ?></h1>
        <?php endif;?>
        <?php if( $section_subtitle != '' ):?>
        <h3 class="section-subtitle"><?php echo do_shortcode($section_subtitle);?></h3>
         <?php endif;?>
         
        
        
        <div class="<?php echo $onetone_animated;?>" data-animationduration="1.2" data-animationtype="bounceIn" data-imageanimation="no">
    <div class="magee-pricing-table row  no-margin 4_columns" id="">
    <?php 
	for($j=1;$j<=4;$j++):
	
	$featured = absint(onetone_option('section_featured_'.$i.'_'.$j));
	$icon = str_replace('fa-','',esc_attr(onetone_option('section_icon_'.$i.'_'.$j)));
	$image = esc_attr(onetone_option('section_image_'.$i.'_'.$j));
	$currency = esc_attr(onetone_option('section_currency_'.$i.'_'.$j));
	$price    = esc_attr(onetone_option('section_price_'.$i.'_'.$j));
	$unit     = esc_attr(onetone_option('section_unit_'.$i.'_'.$j));
	$title    = esc_attr(onetone_option('section_title_'.$i.'_'.$j));
	$features = onetone_option('section_features_'.$i.'_'.$j);
	$button_text = onetone_option('section_button_text_'.$i.'_'.$j);
	$button_link = onetone_option('section_button_link_'.$i.'_'.$j);
	$button_target = onetone_option('section_button_target_'.$i.'_'.$j);
	
	?>
<div class="magee-pricing-box-wrap  col-md-3 no-padding">
                                            <div class="panel panel-default text-center  magee-pricing-box <?php echo $featured=='1'?'featured':'';?>">
                                                <div class="panel-heading">
                                                    <div class="pricing-top-icon">
                                                    <?php if( $image !="" ):?>
                                                    <img src="<?php echo $image ;?>" alt=""/>
                                                    <?php else:?>
                                                        <i class="fa fa-<?php echo $icon ;?>"></i>
                                                        <?php endif;?>
                                                    </div>
                                                    <h3 class="panel-title prcing-title"><?php echo $title ;?></h3>
                                                </div>
                                                <div class="panel-body">
                                                    <div class="pricing-tag">
                                                        <span class="currency"><?php echo $currency ;?></span><span class="price"><?php echo $price ;?></span><span class="unit"><?php echo $unit?'/ '.$unit:'' ;?></span>
                                                    </div>
                                                    <ul class="pricing-list">
                                                    <?php
													if( $features ){
			
														  $features = explode("\n",$features);
														  foreach( $features as $feature ){
															  if( $feature != '' ){
																	echo '<li>'.$feature.'</li>';
																  }
															  }
														  
														  }
														  ?>
                                                    </ul>
                                                </div>
                                                <div class="panel-footer">
                                                    <a href="<?php echo $button_link ;?>" target="<?php echo $button_target ;?>" class="magee-btn-normal"><i class="fa fa-shopping-cart"></i> <?php echo $button_text ;?></a>
                                                </div>
                                            </div>
                                        </div>
                           <?php endfor;?>
</div></div>
        
        
          </div>
            <?php
		else:
		?>
        <?php if( $section_title != '' ):?>
        <h2 class="section-title"><?php echo do_shortcode($section_title);?></h2>
        <?php endif;?>
          
            <div class="home-section-content">
            <?php 
			if(function_exists('Form_maker_fornt_end_main'))
             {
                 $section_content = Form_maker_fornt_end_main($section_content);
              }
			 echo do_shortcode($section_content);
			?>
            </div>
                <?php 
		endif;
		?>
        </div>
  <div class="clear"></div>
</section>