-
Notifications
You must be signed in to change notification settings - Fork 0
/
_old_index.php
114 lines (103 loc) · 3.74 KB
/
_old_index.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
<?php get_header(); ?>
<body <?php body_class(); ?>>
<!--[if IE]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
<![endif]-->
<header class="main-header">
<a class="logo" href="<?php echo home_url(); ?>" title="<?php bloginfo('name'); ?>">
<img src="<?php echo get_template_directory_uri(); ?>/img/logo.svg" alt="<?php bloginfo('name'); ?>" />
</a>
</header>
<main>
<?php
$args = array (
'post_type' => 'portfolio',
'showposts' => 4,
);
$queryPortfolio = new WP_Query( $args );
if ( $queryPortfolio->have_posts() ):
?>
<section class="portfolio">
<?php
while ( $queryPortfolio->have_posts() ) : $queryPortfolio->the_post();
if ( has_post_thumbnail( get_the_ID() ) ){
$image_id = get_post_thumbnail_id( get_the_ID() );
$featured_image = wp_get_attachment_url( $image_id );
}
$subtitle = get_post_meta(get_the_ID(),'subtitle_meta', 1);
$display = get_post_meta(get_the_ID(),'display_meta', 1);
$color = get_post_meta(get_the_ID(),'color_meta', 1);
if($display == true) {
$itemClass = 'display-half';
} else {
$itemClass = '';
}
?>
<article class="item-project <?php echo $itemClass; ?>" style="background-color:<?php echo $color; ?>;">
<?php if($featured_image) { ?>
<img class="item-image" src="<?php echo $featured_image; ?>" alt="<?php echo get_the_title(); ?>"/>
<?php } ?>
<div class="item-content">
<h1 class="item-title"><?php echo get_the_title(); ?></h1>
<a href="<?php echo get_the_permalink(); ?>" class="btn-white">Learn more</a>
</div>
</article>
<?php
endwhile;
?>
</section>
<?php
endif;
?>
<section class="about">
<span>50% for the world</span>
<h1>We believe good design comes from a deep understanding of how the world works.</h1>
<p>And that’s why for each hour we spend on client proposed projects we invest another hour in self proposed community based projects.<br><br>We measure the importance of these projects not just by how much we learn from them but also how they impact the world in a positive way.</p>
</section>
<?php
$args = array (
'post_type' => 'portfolio',
'showposts' => 1,
'offset' => 4
);
$queryPortfolio = new WP_Query( $args );
if ( $queryPortfolio->have_posts() ):
?>
<section class="portfolio">
<?php
while ( $queryPortfolio->have_posts() ) : $queryPortfolio->the_post();
if ( has_post_thumbnail( get_the_ID() ) ){
$image_id = get_post_thumbnail_id( get_the_ID() );
$featured_image = wp_get_attachment_url( $image_id );
}
$subtitle = get_post_meta(get_the_ID(),'subtitle_meta', 1);
$display = get_post_meta(get_the_ID(),'display_meta', 1);
$color = get_post_meta(get_the_ID(),'color_meta', 1);
if($display == true) {
$itemClass = 'display-half';
} else {
$itemClass = '';
}
?>
<article class="item-project <?php echo $itemClass; ?>" style="background-color:<?php echo $color; ?>;">
<?php if($featured_image) { ?>
<img class="item-image" src="<?php echo $featured_image; ?>" alt="<?php echo get_the_title(); ?>"/>
<?php } ?>
<div class="item-content">
<h1 class="item-title"><?php echo get_the_title(); ?></h1>
<a href="<?php echo get_the_permalink(); ?>" class="btn-white">Learn more</a>
</div>
</article>
<?php
endwhile;
?>
</section>
<?php
endif;
?>
</main>
<footer>
FOOTER
</footer>
</body>
</html>