<?php
//	Load the theme options
$options = get_option( 'newtone_theme_settings' );

//	Get custom post type ==> slider
global $post;
$args = array(
	'post_type' =>'slider',
	'numberposts' => -1,
	'orderby' => 'ASC'
);
$slider_posts = get_posts($args);

//	Show slider only if slides exist
if($slider_posts): 
	if(isset($options['disable_homepage_slider']) && $options['disable_homepage_slider']): ?>
		<script>
		jQuery(function($) {
			$(document).ready(function() {
				$('.home_slider').flexslider({
					animation: "<?php if(mobile_device_detect() == 0) echo 'fade'; else echo 'slide'; ?>",
					pauseOnAction: false,
					pauseOnHover: true,
					slideshowSpeed: <?php if(newtone_ois('homepage_slider_speed')) echo $options['homepage_slider_speed']; else echo 7000; ?>,
					animationSpeed: <?php if(newtone_ois('homepage_slider_animation_speed')) echo $options['homepage_slider_animation_speed']; else echo 600; ?>,
					controlNav: <?php if(isset($options['homepage_slider_controlNav']) && $options['homepage_slider_controlNav']) echo 'false'; else echo 'true'; ?>,
					directionNav: <?php if(isset($options['homepage_slider_directionNav']) && $options['homepage_slider_directionNav']) echo 'false'; else echo 'true'; ?>
				});
			});
		});
		</script>
        
        
        <div style="background-color: white; height: 315px; /*padding-top: 30px; padding-bottom: 15px; padding-left: 20px; */ padding: 30px 0px 15px 20px;">
    		<div class="head-slider">
    			 <div class="home_slider">
    				  <ul class="slides">
    						<?php
    							//	Start the loop
    							foreach($slider_posts as $post) : setup_postdata($post);
    								//	Get data
    								$post_id = get_post($post->ID); 
    								$content = $post_id->post_content;           
    								$slide = wp_get_attachment_image_src(get_post_thumbnail_id(),'home_slider');
    								$url = get_post_meta($post->ID, 'slider_url', TRUE);
    								
    								if(isset($options['homepage_slider_caption_position']) && $options['homepage_slider_caption_position'] == 'Right') $cap_pos = 'style="right:0"';
    								elseif(isset($options['homepage_slider_caption_position']) && $options['homepage_slider_caption_position'] == 'Left') $cap_pos = ''; 
    								else $cap_pos = '';
    								?>					                    	
    								<li style="/*margin-left: 20px;*/">
    									<img src="<?php echo $slide[0]; ?>" alt="<?php the_title(); ?>" />
    									<?php 
    									if(isset($options['disable_homepage_slider_caption']) && $options['disable_homepage_slider_caption'])
    										if($content)
    											if($url)
    												echo '<p class="flex-caption" '.$cap_pos.'>'.
    													 '<a href="'.$url.'" class="mt-5" title="'.__('Go to ',  'newtone').the_title('','',false).'">'.
    													 '<em class="s2 mb-5">'.the_title('','',false).'</em><span>'.better_excerpt(30,'','','','',true).'</span>'.
    													 '</a></p>';
    											else
    												echo '<p class="flex-caption" '.$cap_pos.'>'.
    													 '<em class="s2 mb-5">'.the_title('','',false).'</em><span>'.better_excerpt(30,'','','','',true).'</span>'.
    													 '</p>';												
    									?>
    								</li>
    						<?php endforeach; ?>
    				  </ul>
    			</div>
    		</div>
            
            <div class="one_half last" style="padding: 10px 0px 57px 20px; background: white; margin-left: -20px;">
                <h1>Una agencia sublime de Escorts</h1>
                <h5><em>Contacte con <strong>Sublime Escorts</strong>&nbsp; y reg&aacute;lese un encuentro inolvidable. Seleccione su <strong>acompa&ntilde;ante de lujo</strong> o d&eacute;jenos ayudarle, d&iacute;ganos como quiere que sea su experiencia..</em></h5>
                <p>&nbsp;</p>
                <div class="shortcode">
                    <ul class="list check">
                        <ul>
                            <li>Modelos de gran belleza</li>
                            <li>M&aacute;xima discreci&oacute;n</li>
                            <li>Encuentros en apartamentos de lujo</li>
                            <li>Salidas a hotel y domicilio</li>
                        </ul>
                    </ul>
                </div>
            </div>
            
        </div>
        
		<!-- END head-slider -->		
	<?php
	endif;
endif;

// load the theme options
$options = get_option( 'newtone_theme_settings' );

// get portfolio column count
$portfolio_columns = newtone_portfolio_col($post->ID);

if($portfolio_columns == '1') { $item_width = 980; $item_height = 551; $img_type = 'full_item_size';} 
if($portfolio_columns == '2') { $item_width = 480; $item_height = 270; $img_type = 'proj_size_2';}
if($portfolio_columns == '3') { $item_width = 313; $item_height = 176; $img_type = 'proj_size_3';}
if($portfolio_columns == '4') { $item_width = 480; $item_height = 300; $img_type = 'proj_size_4';}

$excerpt = 20;
$disp_desc = get_post_meta($post->ID, 'page_function_enable_desc', TRUE);
if($disp_desc == true){ 
	$description = true;	
	$hover_type = 'type-hover-2';
	$img_hover_type = 'class="img-hover-2"'; 
}else{ 
	$description = false;
	$hover_type = '';
	$img_hover_type = '';
}
?>
<div class="portfolio" style="background-color: white; height: 100%">
<div style="margin-left: 20px;"> 
    <a class="moreModels" href="<?php bloginfo('url'); ?>/modelos/">M&aacute;s modelos</a>
    <h3 class="title-color text-t no-margin">&Uacute;ltimos modelos incorporados</h3>
    <div class="divider top nm-t mb-20"></div>
    <ul class="ourHolder col-<?php echo $portfolio_columns; ?>">
		<?php
        query_posts(array(
			'post_type'=>'portfolio',
			'posts_per_page' => 4,
			'paged'=>$paged
		 ));
        
        // start counter at 0
        $portfolio_count=0;
		if (have_posts()) :
        while (have_posts()) : the_post();
			// get full-sized image
			$full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full-size');
			$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), $img_type);
			// get post categories
			$terms = get_the_terms ($post->id, 'portfolio_cats');
			// add to counter
			$portfolio_count++;
			?>  
			<li class="item" style="width: 200px !important; margin-right: 5% !important;" data-id="id-<?php echo $portfolio_count; ?>" data-type="<?php if($terms) {  foreach ($terms as $term) { echo $term->slug . ''; } }?>">
				<?php if($thumbnail[0]) : ?>
                    <div class="img-blok" style="height:<?php echo $item_height; ?>px">
                        <img style="width: 100%!important; height: 360px;" src="<?php echo $full_image[0]; ?>" alt="<?php the_title();?>" <?php echo $img_hover_type; ?>/>
                        <div class="hover-info var-<?php echo $portfolio_columns.' '.$hover_type; ?>">
                            <h3><?php newtone_cut(the_title('','',false), 70); ?></h3>
                            <span class="desc"><?php _e('by',  'newtone'); ?> <?php the_author_posts_link(); ?></span>
                            <?php  better_excerpt($excerpt,'','','plain','no'); ?>
                            <div class="type-post <?php echo newtone_block_type(false, $post->ID, 'portfolio_'); ?>" title="<?php echo newtone_block_type(true, $post->ID, 'portfolio_'); ?>"></div>
                            <a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><div class="butt-control-1"></div></a>
                            <a href="<?php echo $full_image[0]; ?>" rel="prettyPhoto" title="<?php the_title();?>"><div class="butt-control-2"></div></a>
                        </div>
                    </div>
                <?php else : ?>
                    <a href="<?php the_permalink(); ?>" title="<?php the_title();?>">
                    	<?php newtone_events($item_width, $item_height, $post->ID, 'portfolio_', 'middle');  ?>
                    </a>
                <?php endif; 
                
                if($description) : ?>
                    <h3><a href="<?php the_permalink(); ?>" class="title-color"><?php the_title(); ?></a></h3>
                    <hr class="else-hr">          
                    <?php  better_excerpt($excerpt,'','','plain','no'); ?> 
                    <div class="blok-asc else-hr">  
                    </div>           
                <?php endif; ?>
                <h4 class="nm-b"><a class="s4" href="<?php the_permalink(); ?>" title="<?php the_title();?>"><?php newtone_cut(the_title('','',false), 70); ?></a></h4>
                <hr class="else-hr" />
            </li>
			<!-- end id-<?php echo $portfolio_count; ?> --->  
        <?php 
		endwhile;
		endif;
		?>
    </ul>
    <!--END ourHolder-->

</div>
</div>

<div id="infoextra" style="background-color: white; height: 100%; float: left;">
    <div class="hr" style="width: 98%; margin-left: 10px;"></div>

    <div class="three_fourth" style="margin-left: 20px; width: 70%;">
        <h1>Qui&eacute;nes somos</h1>
        <div class="quienesSomos" style="margin-bottom: 20px;">Bienvenido a <em><strong>Escort Exclusivo</strong></em>, una <em><strong>agencia de acompa&ntilde;antes de lujo en Barcelona</strong></em> cuya voluntad es facilitarle encuentros exquisitos con se&ntilde;oritas no profesionales para crear un momento lleno de magia, sensualidad y emoci&oacute;n. Modelos, azafatas de imagen, empresarias o universitarias que son seleccionadas bajo rigurosos criterios de belleza, distinci&oacute;n e inteligencia para establecer una relaci&oacute;n voluntaria, confidencial y discreta. Pensando en ti, este es nuestro compromiso, y por ello ponemos todo nuestro coraz&oacute;n y empe&ntilde;o en crear para usted el encuentro ideal en todos los aspectos, desde la elecci&oacute;n de la se&ntilde;orita m&aacute;s adecuada hasta el m&aacute;s m&iacute;nimo detalle. Todas las fotograf&iacute;as de nuestra galer&iacute;a corresponden a se&ntilde;oritas mayores de edad, son actuales y 100% reales.</div>
        <div class="line_quote mb-20">
            <h2>Sobre nuestras chicas</h2>
            <p>Nuestras chicas no son profesionales, son personas con una vida normal, ocupaciones, estudios, etc..., liberales, discretas, extrovertidas y bellas, con un nivel cultural medio/alto, que quieren mantener contactos voluntarios y espor&acute;dicos con caballeros educados, respetuosos y amables. Por ello y para garantizar que la compa&ntilde;era elegida est&acute; disponible, todos los encuentros con nuestras escorts son siempre con cita previa, para que todo salga a la perfecci&oacute;n. En todo caso, si la se&ntilde;orita seleccionada no est&acute; disponible, y usted lo desea, le ayudaremos a elegir la mejor alternativa. Si est&acute; pensando en un momento de relax, un masaje, una cena &iacute;ntima, un fin de semana de placer, la compa&ntilde;&iacute;a para un viaje de negocios o bien organizar una fiesta, ll&aacute;menos o contacte con nosotros. En <em><strong>Escort Exclusivo</strong></em>&nbsp;estamos comprometidos con la excelencia y la calidad de nuestros servicios.Somos una <em><strong>agencia de escorts en Barcelona</strong></em>, independiente y genuina.</p>
        </div>
    </div>
    
    <?php
    
        query_posts(array(
			'post_type'=>'portfolio',
			'posts_per_page' => 1,
            'orderby' => 'rand'
		 ));
         the_post();
        
        $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full-size');

    ?>
    
    <div class="one_fourth last" style="margin-top: 15px;">
        <div id="fotoEscSemana">
            <div class="titlEsc">
                <h1>Escort de la semana</h1>
            </div>
            <div class="conjFoto" style="margin: auto;">
                <div class="fotoEsc">
                    <a href="<?php echo $full_image[0]; ?>" rel="prettyPhoto">
                        <img class="alignnone size-medium wp-image-1600" alt="<?php the_title();?>" src="<?php echo $full_image[0] ?>" width="200" height="300" />
                    </a>
                </div>
                <div class="txtEsc">
                    <a title="Ver Escort destacada de la semana" href="<?php the_permalink(); ?>">Ver detalles en servicios</a>
                </div>
            </div>
        </div>

    </div>
</div>
<!--END portfolio--> 

<?php wp_reset_postdata();  ?>