-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
179 lines (139 loc) · 4.85 KB
/
header.php
File metadata and controls
179 lines (139 loc) · 4.85 KB
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
<!DOCTYPE html>
<html>
<div id="container">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.topWrapper{ width: 100%; height: 200px; background-image: url(<?php echo get_theme_mod("cover_image"); ?>); background-size: 100% 100%; position: relative; }
</style>
<title>
<?php
if(is_single()){
$title = wp_title('', FALSE);
$title .= " - ";
$title .= get_bloginfo('name');
echo $title;
}
else{
bloginfo('name');
}
?>
</title>
<meta charset="<?php bloginfo('charset'); ?>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
<link href='https://fonts.googleapis.com/css?family=Lato:700,400,300,100|Open+Sans:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<?php wp_head(); ?>
</head>
<div id="header">
<?php if (!is_singular('project')) { ?>
<div id="cover_image" class="topWrapper">
<div class="profileContainer">
<a href="/"><img id="profile_image" class="profilePicture" src="<?php echo get_theme_mod("profile_image"); ?>" /></a>
</div>
</div>
<?php }; ?>
<p id="header_title" class="introMsg">
<?php if (get_theme_mod("header_title") == ""){
echo bloginfo('name');
}
else{
echo get_theme_mod("header_title");
}
?>
</p>
<p id="header_caption" class="subMsg">
<?php if (get_theme_mod("header_caption") == ""){
echo bloginfo('description');
}
else{
echo get_theme_mod("header_caption");
}
?>
</p>
<hr>
<div class="linkWrapper">
<?php if(get_theme_mod("about_link") != ""){ ?>
<a class="bar" id="about_link" href="<?php echo get_theme_mod("about_link") ;?>">About</a>
<?php }; ?>
<?php if(get_theme_mod("github_link") != ""){ ?>
<a class="bar" id="github_link" href="<?php echo get_theme_mod("github_link") ;?>">Github</a>
<?php }; ?>
<?php if(get_theme_mod("resume_link") != ""){ ?>
<a class="bar" id="resume_link" href="<?php echo get_theme_mod("resume_link") ;?>">Resume</a>
<?php }; ?>
<?php if(get_theme_mod("linkedin_link") != ""){ ?>
<a class="bar" id="linkedin_link" href="<?php echo get_theme_mod("linkedin_link") ;?>">LinkedIn</a>
<?php }; ?>
<?php if(get_theme_mod("custom1_link") != "" && get_theme_mod("custom1name_link") != ""){ ?>
<a class="bar" id="custom1_link" href="<?php echo get_theme_mod("custom1_link") ;?>"><?php echo get_theme_mod("custom1name_link");?></a>
<?php }; ?>
<?php if(get_theme_mod("custom2_link") != "" && get_theme_mod("custom2name_link") != ""){ ?>
<a class="bar" id="custom2_link" href="<?php echo get_theme_mod("custom2_link") ;?>"><?php echo get_theme_mod("custom2name_link");?></a>
<?php }; ?>
<?php if(get_theme_mod("custom3_link") != "" && get_theme_mod("custom3name_link") != ""){ ?>
<a class="bar" id="custom3_link" href="<?php echo get_theme_mod("custom3_link") ;?>"><?php echo get_theme_mod("custom3name_link");?></a>
<?php }; ?>
</div>
<hr>
<div id="showCase">
<?php
$args = array( 'post_type' => 'project');
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a href="<?php the_permalink(); ?>">
<div class="showItem">
<div class="text"><?php the_title();?></div>
<img src="<?php the_post_thumbnail_url(); ?>"/>
</div>
</a>
<?php endwhile; ?>
</div>
<div id="siteController" class="siteController">
<button class="shrinkController">Shrink</button>
<button class="expandController">Expand</button>
</div>
</div>
<script>
var page = <?php echo json_encode(is_single()); ?>;
var project = <?php echo json_encode(is_singular('project')); ?>;
if( page == true && project == true){
$('#showCase').animate({height:'0px'})
}
else if( page == true){
$('#showCase').animate({height:'0px'})
}
$('.shrinkController').click(function(){
if ($('#showCase').height() == 180){
$('#showCase').animate({height:'0px'})
}
else if($('#showCase').height() > 180){
$('#showCase').animate({height:'180px'})
}
})
$('.expandController').click(function(){
var oneColumn = window.matchMedia("(max-width: 523px)");
var twoColumns = window.matchMedia("(max-width: 768px) and (min-width: 524px)");
if ($('#showCase').height() == 0){
$('#showCase').animate({height:'180px'})
}
else if($('#showCase').height() == 180 && oneColumn.matches){
var items = $('#showCase').children().length;
var height = items * 180;
$('#showCase').animate({height:height});
}
else if($('#showCase').height() == 180 && twoColumns.matches){
var items = $('#showCase').children().length;
var rows = Math.ceil(items / 2);
var height = rows * 180;
$('#showCase').animate({height:height});
}
else if ($('#showCase').height() == 180){
var items = $('#showCase').children().length;
var rows = Math.ceil(items / 3);
var height = rows * 180;
$('#showCase').animate({height:height});
}
})
</script>