-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle-meucv_plugin.php
211 lines (188 loc) · 6.54 KB
/
single-meucv_plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
/**
* Tema construido no Desafio21Dias
*
* @link http://torneseumprogramador.com.br
*
* @package WordPress
* @subpackage Desafio21Dias
* @since Desafio21Dias
*/
$foto = get_stylesheet_directory_uri()."/meu-cv.jpg";
$nome="";
$profissao="";
$email="";
$site ="";
$celular="";
$resumo ="";
$experiencias="";
$habilidades="";
$escolaridade="";
$template_experiencias ='<article>
<h2>#cargo_empresa</h2>
<p class="subDetails">#de_ate</p>
<p>#descricao</p>
</article>';
$template_habilidades="<li>#habilidade</li>";
$template_escolaridade='<article>
<h2>#instituicao</h2>
<p class="subDetails">#curso</p>
<p>#descricao</p>
</article>';
if( have_posts() ) :
while ( have_posts() ) :
the_post();
if (get_field('secao')){
$secao = get_field('secao')[0];
}
if ( $secao == "Dados Pessoais"){
$nome = get_field('nome_completo') ? get_field('nome_completo') : "SEU NOME AQUI";
$profissao=get_field('profissao') ? get_field('profissao') : "SUA PROFISSAO";
$email=get_field('email') ? get_field('email') : "SEU EMAIL";
$site =get_field('site') ? get_field('site') : "SEU SITE";
$celular=get_field('celular') ? get_field('celular') : "SEU CELULAR";
if ((function_exists ('has_post_thumbnail')) && (has_post_thumbnail()))
{
$foto = get_the_post_thumbnail (get_the_ID());
} else {
$foto = "<img src='".$foto."' alt='Meu CV' />";
}
}
if ( $secao == "Resumo Profissional"){
$resumo = get_field('descricao') ? get_field('descricao') : "SEU RESUMO";
}
if ( $secao == "Experiências"){
$cargo_empresa=get_field('descricao_titulo') ? get_field('descricao_titulo') : ".";
$de=get_field('mesano_inicial') ? get_field('mesano_inicial') : ".";
$ate=get_field('mesano_final') ? get_field('mesano_final') : ".";
$descricao=get_field('descricao') ? get_field('descricao') : ".";
$tmpl = $template_experiencias;
if($cargo_empresa != ".") :
$tmpl = str_replace("#cargo_empresa",$cargo_empresa,$tmpl);
endif;
if($de != "." && $ate != ".") :
$tmpl = str_replace("#de_ate",$de .' - '.$ate,$tmpl);
endif;
if($descricao != ".") :
$tmpl = str_replace("#descricao",$descricao,$tmpl);
endif;
$experiencias.= $tmpl;
}
if ( $secao == "Habilidades"){
$descricao = get_field('descricao') ? get_field('descricao') : ".";
$tmpl = $template_habilidades;
if($descricao !="."):
$tmpl = str_replace("#habilidade",$descricao,$tmpl);
endif;
$habilidades.= $tmpl;
}
if ( $secao == "Escolaridade"){
$instituicao = get_field('descricao_titulo') ? get_field('descricao_titulo') : ".";
$curso = get_field('descricao') ? get_field('descricao') : ".";
$descricao = !empty(get_the_content())?get_the_content():".";
$tmpl = $template_escolaridade;
if($instituicao !="."):
$tmpl = !empty($instituicao)? str_replace("#instituicao",$instituicao,$tmpl):$tmpl;
endif;
if($curso !=".") :
$tmpl = !empty($curso)? str_replace("#curso",$curso,$tmpl): $tmpl;
endif;
if($descricao!="."):
$tmpl = ($descricao !="")? str_replace("#descricao",$descricao,$tmpl) : $tmpl;
endif;
$escolaridade.= $tmpl;
}
endwhile;
else:?>
<p> Nenhum post encontrado!</p>
<?php
endif;
?>
<!DOCTYPE html>
<html class="no-js" <?php language_attributes(); ?>>
<head>
<!-- O título -->
<title><?php wp_title(''); ?></title>
<meta name="viewport" content="width=device-width" />
<meta name="description" content="<?php wp_title(''); ?>" />
<!-- O charset padrão -->
<meta charset="<?php bloginfo('charset'); ?>">
<?php //css
wp_enqueue_style('meu-cv-css', get_stylesheet_directory_uri().'/meu-cv.css');
wp_enqueue_style('meu-cv-css','http://fonts.googleapis.com/css?family=Rokkitt:400,700|Lato:400,300');
?>
<!--
O restante do cabeçalho que virá dentro da head.
Criado automaticamente pelo WordPress.
-->
<?php wp_head(); ?>
</head>
<body id="top">
<div id="cv" class="instaFade">
<div class="mainDetails">
<div id="headshot" class="quickFade">
<?php echo $foto;?>
</div>
<div id="name">
<h1 class="quickFade delayTwo"><?php echo $nome;?></h1>
<h2 class="quickFade delayThree"><?php echo $profissao;?></h2>
</div>
<div id="contactDetails" class="quickFade delayFour">
<ul>
<li>e: <a href="mailto:<?php echo $email;?>" target="_blank"><?php echo $email;?></a></li>
<li>w: <a href="<?php echo $site;?>"><?php echo $site;?></a></li>
<li>m: <?php echo $celular;?></li>
</ul>
</div>
<div class="clear"></div>
</div>
<div id="mainArea" class="quickFade delayFive">
<section>
<article>
<div class="sectionTitle">
<h1>O que tenho para oferecer</h1>
</div>
<div class="sectionContent">
<p><?php echo $resumo;?></p>
</div>
</article>
<div class="clear"></div>
</section>
<section>
<div class="sectionTitle">
<h1>EXPERIÊNCIA RELEVANTE</h1>
</div>
<div class="sectionContent">
<?php echo $experiencias;?>
</div>
<div class="clear"></div>
</section>
<section>
<div class="sectionTitle">
<h1>HABILIDADE TÉCNICAS</h1>
</div>
<div class="sectionContent">
<ul class="keySkills">
<?php echo $habilidades;?>
</ul>
</div>
<div class="clear"></div>
</section>
<section>
<div class="sectionTitle">
<h1>FORMAÇÃO ACADÊMICA</h1>
</div>
<div class="sectionContent">
<?php echo $escolaridade;?>
</div>
<div class="clear"></div>
</section>
</div>
</div>
<!--
O restante do rodapé que virá dentro do body.
Criado automaticamente pelo WordPress.
-->
<?php wp_footer(); ?>
</body>
</html>