| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/successkpi/wp-content/themes/successkpi/blocks/text-with-form/ |
Upload File : |
<?php
if (function_exists('render_block_preview_image') && render_block_preview_image($block, 'Text With Form Preview')) {
return;
}
$anchor = '';
if ( ! empty( $block['anchor'] ) ) {
$anchor = 'id="' . esc_attr( $block['anchor'] ) . '" ';
}
$className = 'registration-section sk-section-spacing ' . ($block['className'] ?? '');
$form_id = get_field('form_id');
?>
<section <?php echo $anchor; ?> class="<?php echo esc_attr(trim($className)); ?>">
<div class="container">
<div class="registration-section-wrapper" id="white-paper">
<div class="registration-section-content" data-aos="fade-up">
<?php $heading = get_field('heading');
if (isset($heading) && !empty($heading)): ?>
<h2><?php echo esc_html($heading); ?></h2>
<?php endif;
$description = get_field('description');
if (isset($description) && !empty($description)):
echo wp_kses_post($description);
endif; ?>
<div class="registration-section-image" data-aos="fade-up">
<?php $left_image = get_field('left_image');
if (isset($left_image) && !empty($left_image)): ?>
<img decoding="async" alt="<?php echo (isset($left_image['alt']) && !empty($left_image['alt'])) ? esc_attr($left_image['alt']) : ''; ?>" src="<?php echo esc_url($left_image['url']); ?>"><?php endif; ?>
</div>
</div>
<div class="registration-section-form">
<?php $second_heading = get_field('second_heading');
if (!empty($second_heading)) : ?>
<h2><?php echo esc_html($second_heading); ?></h2>
<?php endif; ?>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script data-hubspot-rendered="true">
hbspt.forms.create({
region: "na1",
portalId: "21157292",
formId: "<?php echo $form_id; ?>",
sfdcCampaignId: "",
css: " ",
onFormReady: ($form) => {
const formInputs = $form.find(".hs-fieldtype-text input");
formInputs.each(function() {
const input = this;
/* Add class on load if input has value*/
if (input.value) {
input.closest(".hs-fieldtype-text").classList.add("focused");
}
/* Add class on focus*/
input.addEventListener("focus", () => {
input.closest(".hs-fieldtype-text").classList.add("focused");
});
/* Remove class if empty on blur*/
input.addEventListener("blur", () => {
if (!input.value) {
input.closest(".hs-fieldtype-text").classList.remove("focused");
}
});
});
}
});
</script>
</div>
</div>
</div>
</div>
</section>