This repository was archived by the owner on Jan 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
49 lines (39 loc) · 1.62 KB
/
front-page.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
<?php
/*
Template Name: Home
*/
get_header(); ?>
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<?php if ( wp_is_mobile() ) {
$img = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large', false, '' ); } else {
$img = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full', false, '' ); } ?>
<div class="hero bg-black h-[550px] lg:h-[720px]">
<div class="full-container h-full">
<?php if ( has_post_thumbnail() ) : ?>
<div class="absolute inset-0">
<img class="h-full w-full object-cover" src="<?php echo $img[0]; ?>" alt="">
<div class="absolute inset-0 opacity-40 bg-black"></div>
</div>
<?php endif; ?>
<div class="relative site-container flex items-center h-full">
<article class="lead max-w-4xl mx-auto text-center<?php if ( has_post_thumbnail() ) : ?> text-white<?php endif; ?>">
<?php the_content(); ?>
<?php $link = get_field('link');
if( $link ):
$link_url = $link['url'];
$link_title = $link['title'];
$link_target = $link['target'] ? $link['target'] : '_self';
?>
<a class="btn btn-dark mx-auto"
href="<?php echo esc_url($link_url); ?>"
target="<?php echo esc_attr( $link_target ); ?>" >
<?php echo esc_html($link_title); ?>
</a>
<?php endif; ?>
</article>
</div>
</div>
</div>
<?php get_template_part( 'page', 'modules' ); ?>
<?php endwhile; endif; ?>
<?php get_footer(); ?>