Server IP : 89.26.249.46  /  Your IP : 216.73.216.42
Web Server : Apache
System : Linux a.cp.cloudlink.pt 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User : eticalga ( 1129)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/eticalga/www/files/themes/kobuxeticalgarve/templates/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/eticalga/www/files/themes/kobuxeticalgarve/templates/homepage.php
<?php

/**
 * Template Name: Homepage
 *
 * @package kobuxeticalgarve
 */

get_header(); ?>
<article id="content">
	<?php while (have_posts()) : the_post(); ?>
		<?php include(locate_template('partials/page-top.php')); ?>

		<div class="site-content">
			<div id="hp-highlights">
				<div class="svg-animate wave" data-shape="shape-01" data-morph="amount"></div>
				<?php if (have_rows('hp_highlights')) { ?>
					<div class="hp-highlight-slides">
						<?php
						$first_slide_data = array();
						$slide = 1;

						while (have_rows('hp_highlights')) {
							the_row();
							$hp_hl_title = get_sub_field('hp_hl_title');
							$hp_hl_description = get_sub_field('hp_hl_description');
							$hp_hl_file_url = get_sub_field('hp_hl_file')['url'];
							$hp_hl_file_type = wp_check_filetype($hp_hl_file_url);
							$hp_hl_url = get_sub_field('hp_hl_url');
							$hp_hl_url_url = isset($hp_hl_url['url']) ? $hp_hl_url['url'] : '';
							$hp_hl_btn_text = get_sub_field('hp_hl_btn_text');

							if ($slide == 1) {
								$first_slide_data['title'] = esc_attr($hp_hl_title);
								$first_slide_data['description'] = esc_html($hp_hl_description);
								$first_slide_data['label'] = esc_html($hp_hl_btn_text);
								$first_slide_data['url'] = esc_url($hp_hl_url_url);
							}
						?>
							<div class="hp-highlight-slide" data-title="<?php echo esc_attr($hp_hl_title); ?>" data-description="<?php echo esc_html($hp_hl_description); ?>" data-cta-label="<?php echo esc_html($hp_hl_btn_text); ?>" data-cta-url="<?php echo esc_url($hp_hl_url_url); ?>">
								<?php if (strpos($hp_hl_file_type['type'], 'image') !== false) { ?>
									<?php echo '<figure>' . wp_get_attachment_image(get_sub_field('hp_hl_file')['id'], '1536x1536', false, array('class' => '', 'sizes' => '100vw', 'loading' => ($slide == 1 ? 'eager' : 'lazy'), 'decoding' => 'async')) . '</figure>'; ?>
								<?php } elseif (strpos($hp_hl_file_type['type'], 'video') !== false) { ?>
									<video loop muted playsinline>
										<source src="<?php echo esc_url($hp_hl_file_url); ?>" type="<?php echo esc_attr($hp_hl_file_type['type']); ?>">
									</video>
								<?php } ?>
							</div>
							<?php $slide++; ?>
						<?php } ?>
					</div>

					<div class="hp-highlight-info">
						<div class="hp-highlight-navigation">
							<button class="arrow arrow--left" type="button" aria-label="Previous"><?php echo kobuxeticalgarve_get_icons('icon-arrow'); ?></button>
							<div class="pagination">01/<?php echo ($slide) > 9 ? ($slide - 1) : '0' . ($slide - 1); ?></div>
							<button class="arrow arrow--right" type="button" aria-label="Next"><?php echo kobuxeticalgarve_get_icons('icon-arrow'); ?></button>
						</div>
						<h2><?php echo isset($first_slide_data['title']) ? $first_slide_data['title'] : ''; ?></h2>
						<p><?php echo isset($first_slide_data['description']) ? $first_slide_data['description'] : ''; ?></p>
						<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
							<div class="wp-block-button"><a href="<?php echo isset($first_slide_data['url']) ? $first_slide_data['url'] : '#'; ?>" class="wp-block-button__link wp-element-button"><?php echo isset($first_slide_data['label']) ? $first_slide_data['label'] : '#'; ?></a></div>
						</div>
					</div>
				<?php } ?>

				<span id="scroll-down">scroll down</span>
			</div>

			<?php the_content(); ?>
		</div>
	<?php endwhile; ?>
</article>

<?php
$homepage_form_cta = get_field('homepage_form_cta', 'options');
$homepage_form_cta_text = isset($homepage_form_cta['cta_text']) ? $homepage_form_cta['cta_text'] : __('Fala connosco', 'kobu');
$homepage_form_form_select = isset($homepage_form_cta['form_select']) ? $homepage_form_cta['form_select'] : null;

if ($homepage_form_form_select) { ?>
	<div id="cta-interest-registration" class="cta-modal-button"><?php echo $homepage_form_cta_text; ?><?php echo kobuxeticalgarve_get_icons('icon-arrow'); ?></div>
	<div id="interest-registration-modal-wrapper" class="cta-modal-wrapper">
		<div id="interest-registration-modal">
			<div>
				<div id="interest-registration-close"><?php echo kobuxeticalgarve_get_icons('icon-close'); ?></div>
				<?php gravity_form(esc_attr($homepage_form_form_select), false, false, false, null, true, 0, true, 'gravity'); ?>
			</div>
		</div>
	</div>
<?php } ?>

<?php get_footer(); ?>