<?php defined('ABSPATH') or die('No Script Cuddies');
/*
Template Name: Sobre Mim
*/
global $post;
$copypost=$post;
get_header();
$img=(wp_get_attachment_image_src(get_post_thumbnail_id())!==false)?wp_get_attachment_image_src(get_post_thumbnail_id(),'full'):wp_get_attachment_image_src(get_post_thumbnail_id(get_bloginfo('page_on_front')),'full');
?>
<div class="coloured-madness-cast">
	<div class="container">
		<div class="spacer-85"></div>
		<div class="cast-container">
			<div class="cast-tabs row">
				<h3 align="center"><?=the_title();?></h3>
			</div>
		</div>
		<div class="cast-container">
			<div class="row">
				<div class="col-xs-12 col-md-6 col-lg-4">
					<div class="cast-tabs row no-margin-removal">
						<div class="col-xs-12 profile_img_container">
							<img src="<?=get_field('imagem_de_perfil')['sizes']['thumbnail'];?>">
						</div>
					</div>
					<div class="cast-tabs row no-margin-removal">
						<div class="col-xs-12">
							<strong><?=__('Name','portfolio_madness');?>:</strong> <?=get_field('nome_completo');?>
						</div>
					</div>
					<div class="cast-tabs row no-margin-removal">
						<div class="col-xs-12">
							<strong><?=__('Age / Birtday','portfolio_madness');?>:</strong>
							<?php 
							$aniversario=get_field('aniversario');
							$na=explode('/',$aniversario);
							$_age = floor((time() - strtotime($na[2].'/'.$na[1].'/'.$na[0])) / 31556926);
							?> 
							<p><?=$_age;?> / <?=$aniversario;?></p>
						</div>
					</div>
					<div class="cast-tabs row no-margin-removal">
						<div class="col-xs-12">
							<strong><?=__('Naturalness','portfolio_madness');?>: </strong> <?=get_field('naturalidade')?>
						</div>
					</div>
					<div class="cast-tabs row no-margin-removal">
						<div class="col-xs-12">
							<strong><?=__('Current Ocupation','portfolio_madness');?>:</strong> <?=get_field('ocupação')?>
						</div>
					</div>
					<div class="cast-tabs row no-margin-removal">
						<div class="col-xs-12">
							<strong><?=__('Civil Status','portfolio_madness');?>:</strong> <?=get_field('estado_civil')?>
						</div>
					</div>
				</div>
				<div class="col-xs-12 col-md-6 col-lg-8">
					<div class="cast-tabs row no-margin-removal">
						<div class="col-xs-12">
							<?php 
							$post=$copypost;
							$content = get_the_content($post->ID);
							if($content==''){
								$content = apply_filters( 'the_content', $post->post_content );
    							$content = str_replace( ']]>', ']]&gt;', $content );
							}
							echo $content;
							?>
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php 
		if(is_user_logged_in()){
			?>
		<div class="cast-container">
			<div class="row">
				<div class="col-xs-12 col-md-6 col-lg-12">
					<div class="cast-tabs row no-margin-removal">
						<div class="col-xs-12">
							<a class="button" href="<?php echo get_edit_post_link( $id, $context ); ?>">
								<?=__('Edit This Post',tdomain);?>
							</a>
						</div>
					</div>
				</div>
			</div>
		</div>
			<?php
		} ?>
	</div>
</div>
<?php
get_footer();

