• I created a website for my business in 2020. I have been maintaining it myself solo since then. I am not well versed on WordPress and did not change anything. All of a sudden, I start getting messages. The last two read…

    Howdy! Plugins failed to update on your site at. Please check your site now. It’s possible that everything is working. If there are updates available, you should update.The following plugins failed to update. If there was a fatal error in the update, the previously installed version has been restored.

    – The Bluehost Plugin (from version 3.14.7 to 3.14.8) : https://bluehost.com

    – All in One SEO (from version 4.6.9.1 to 4.7.0) : https://www.ads-software.com/plugins/all-in-one-seo-pack/

    I don’t know what to do. All I know is my slider and the sections on my homepage aren’t showing like they used to display, and I didn’t change anything.

    THANKS IN ADVANCE TO ANYONE WHO CAN HELP.

    • This topic was modified 2 months, 2 weeks ago by dsturner.
    • This topic was modified 2 months, 2 weeks ago by James Huff. Reason: redundant link removed

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hello there,

    It seems that you are using some custom code for the slider – https://prnt.sc/fafXNxWKfo-l – We see this error in the console -> https://prnt.sc/-cZh6iB8cxUz – which means that jQuery is not properly initialized on the page. You can try to replace your current JS code with this:

    <script>
    var bedroom_values = false;
    var bathroom_values = false;

    jQuery(document).ready(function() {
    // Slider front start
    jQuery('#ui-slider1').slider({
    orientation: "horizontal",
    animate: "fast",
    range: "min",
    min: 1,
    step: 1,
    max: 6,
    value: 1,
    slide: function(e, t) {
    var input = jQuery('input[name="service_id"]');
    switch (t.value) {
    default:
    input.val(1);
    }

    for (var i = 0; i < bedroom_values.length; i++) {
    if (input.val() == bedroom_values[i].slider_l27_value) {
    jQuery('[data-bedroom-message]').val(bedroom_values[i].bedroom_values_text);
    }
    }

    jQuery('#ui-slider__amount1').val(t.value);
    }
    });

    jQuery('#ui-slider2').slider({
    orientation: "horizontal",
    animate: "fast",
    range: "min",
    min: 1,
    step: 1,
    max: 6,
    value: 1,
    slide: function(e, t) {
    var input = jQuery('input[name="pricing_param_quantity"]');
    switch (t.value) {
    default:
    input.val(1);
    }

    for (var i = 0; i < bathroom_values.length; i++) {
    if (input.val() == bathroom_values[i].slider_bathroom_l27_value) {
    jQuery('[data-bathroom-message]').val(bathroom_values[i].bathroom_values_text);
    }
    }

    jQuery('#ui-slider__amount2').val(t.value);
    }
    });
    });

    // Slider counter and price update
    var BEDROOM_RATES = {};
    var PER_BATHROOM = 25;

    jQuery(window).ready(function() {
    updatePrice();
    jQuery('input[type=radio]').on('change', updatePrice);
    jQuery('#ui-slider1, #ui-slider2').on('slidechange', updatePrice);
    });

    function updatePrice() {
    var perc_off = 0.0,
    bedrooms = jQuery('#ui-slider1').slider('option', 'value'),
    bathrooms = jQuery('#ui-slider2').slider('option', 'value'),
    freq_id = jQuery('input[type=radio]:checked').attr('id'),
    total_price = 0;

    total_price = BEDROOM_RATES['b' + bedrooms];
    total_price += bathrooms * PER_BATHROOM;

    if (freq_id == 'r1') {
    // one time
    perc_off = 0;
    } else if (freq_id == 'r2') {
    // every week
    perc_off = 0.2;
    } else if (freq_id == 'r3') {
    // every two weeks
    perc_off = 0.15;
    } else if (freq_id == 'r4') {
    // every four weeks
    perc_off = 0.1;
    }

    // Subtract frequency discount
    total_price *= (1 - perc_off);
    // Set total price on button
    jQuery("#total-price").html(parseFloat(total_price).toFixed(2));
    }

    jQuery(document).on('change', '#ui-slider__amount1', function(e) {
    // Handle change event
    });
    </script>

    Please let us know if that worked. Cheers.

    Thread Starter dsturner

    (@dsturner)

    Thank you for your swift reply. However, it is now throwing me another error:

    Your PHP code changes were not applied due to an error on line 126 of file wp-content/themes/bluedream/page-homepage.php. Please fix and try saving again.

    Uncaught Error: Undefined constant “slider_l27_value” in wp-content/themes/bluedream/page-homepage.php:126

    Stack trace:

    #0 wp-includes/template-loader.php(106): include()

    #1 wp-blog-header.php(19): require_once(‘/home2/bestfiv4…’)

    #2 index.php(17): require(‘/home2/bestfiv4…’)

    #3 {main}

    thrown

    ??

    • This reply was modified 2 months, 2 weeks ago by dsturner.

    You can try to do this, to wrap this slider_I27_value as a string, for example, this part —>

    if (input.val() == bedroom_values[i].slider_l27_value) {

    Become this —>

    if (input.val() == bedroom_values[i]['slider_l27_value']) {

    If that does not work, can you share complete code from page-homepage.php?

    Kind Regards.

    Thread Starter dsturner

    (@dsturner)

    That did not work either. I received the following error:

    Your PHP code changes were not applied due to an error on line 127 of file wp-content/themes/bluedream/page-homepage.php. Please fix and try saving again. syntax error, unexpected token “<“

    Here is the page’s full code:

                 <?php /* Template Name: Homepage */ get_header(); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <main>

    <!-- Begin of .subheader -->
    <section class="subheader pv0"<?php if (get_field('subheader_background')) : ?> style="background-image: url('<?php the_field('subheader_background'); ?>')"<?php endif; ?>>
    <div class="container">
    <div class="text-center mb+">
    <h2 class="color-white type-normal relative" <?php if (function_exists("live_edit")) {
    live_edit('subheader_background, subheader_title, subheader_subtitle, subheader_form_action');
    } ?>><?php the_field('subheader_title'); ?></h2>
    <?php if (get_field('subheader_subtitle')) : ?><p class="color-white type-x-huge type-semibold"><?php the_field('subheader_subtitle'); ?></p><?php endif; ?>
    </div>
    <div class="layout layout--large layout--center">
    <div class="layout__item mb0">
    <script>
    var bedroom_values = false;
    var bathroom_values = false;

    jQuery(document).ready(function() {
    // Slider front start
    jQuery('#ui-slider1').slider({
    orientation: "horizontal",
    animate: "fast",
    range: "min",
    min: 1,
    step: 1,
    max: 6,
    value: 1,
    slide: function(e, t) {
    var input = jQuery('input[name="service_id"]');
    switch (t.value) {
    default:
    input.val(1);
    }

    for (var i = 0; i < bedroom_values.length; i++) {
    if (input.val() == bedroom_values[i].slider_l27_value) {
    jQuery('[data-bedroom-message]').val(bedroom_values[i].bedroom_values_text);
    }
    }

    jQuery('#ui-slider__amount1').val(t.value);
    }
    });

    jQuery('#ui-slider2').slider({
    orientation: "horizontal",
    animate: "fast",
    range: "min",
    min: 1,
    step: 1,
    max: 6,
    value: 1,
    slide: function(e, t) {
    var input = jQuery('input[name="pricing_param_quantity"]');
    switch (t.value) {
    default:
    input.val(1);
    }

    for (var i = 0; i < bathroom_values.length; i++) {
    if (input.val() == bathroom_values[i].slider_bathroom_l27_value) {
    jQuery('[data-bathroom-message]').val(bathroom_values[i].bathroom_values_text);
    }
    }

    jQuery('#ui-slider__amount2').val(t.value);
    }
    });
    });

    // Slider counter and price update
    var BEDROOM_RATES = {};
    var PER_BATHROOM = 25;

    jQuery(window).ready(function() {
    updatePrice();
    jQuery('input[type=radio]').on('change', updatePrice);
    jQuery('#ui-slider1, #ui-slider2').on('slidechange', updatePrice);
    });

    function updatePrice() {
    var perc_off = 0.0,
    bedrooms = jQuery('#ui-slider1').slider('option', 'value'),
    bathrooms = jQuery('#ui-slider2').slider('option', 'value'),
    freq_id = jQuery('input[type=radio]:checked').attr('id'),
    total_price = 0;

    total_price = BEDROOM_RATES['b' + bedrooms];
    total_price += bathrooms * PER_BATHROOM;

    if (freq_id == 'r1') {
    // one time
    perc_off = 0;
    } else if (freq_id == 'r2') {
    // every week
    perc_off = 0.2;
    } else if (freq_id == 'r3') {
    // every two weeks
    perc_off = 0.15;
    } else if (freq_id == 'r4') {
    // every four weeks
    perc_off = 0.1;
    }

    // Subtract frequency discount
    total_price *= (1 - perc_off);
    // Set total price on button
    jQuery("#total-price").html(parseFloat(total_price).toFixed(2));
    }

    jQuery(document).on('change', '#ui-slider__amount1', function(e) {
    // Handle change event
    });
    </script>
    <form action="<?php the_field('subheader_form_action'); ?>" method="get">
    <div class="flag-wrap">
    <div class="flag flag--small mb pb--">
    <div class="flag__img">
    <p class="slider-result-wrap"><?php _e('Bedrooms', 'themestreet'); ?>:
    <input type="text" id="ui-slider__amount1" class="slider-result" value="1">
    <?php
    $repeater = get_field('bedroom_values','options');
    if (input.val() == bedroom_values[i]['slider_l27_value']) {
    </p>
    </div>
    <div class="flag__body">
    <div class="ui-slider-wrap">
    <div id="ui-slider1" data-max='<?php if(get_field('slider_bedrooms_datamax','options')) { echo get_field('slider_bedrooms_datamax','options'); } else { echo '6'; } ?>'></div>
    </div>
    </div>
    </div>
    </div>
    <div class="bedroom__description"><p>
    <?php
    $repeater = get_field('bedroom_values','options');
    $value = $repeater[0][bedroom_values_text];
    ?>
    <input type="text" data-bedroom-message id="ui-slider__amount112" class="slider-result long_input" value="<?php echo $value; ?>">
    </p><span><?php _e('(Kitchen and living room included)', 'themestreet'); ?></span></div>
    <div class="flag-wrap">
    <div class="flag flag--small mb">
    <div class="flag__img">
    <p class="slider-result-wrap"><?php _e('Bathrooms', 'themestreet'); ?>:
    <input type="text" id="ui-slider__amount2" class="slider-result" value="1">
    <?php
    $repeater = get_field('bathroom_values','options');
    $value = $repeater[0][slider_bathroom_l27_value];
    ?>
    <input id="pricing_param_quantity" name="pricing_param_quantity" type="hidden" value="<?php echo $value; ?>">
    </p>
    </div>
    <div class="flag__body">
    <div class="ui-slider-wrap">
    <div id="ui-slider2" data-max='<?php if(get_field('slider_bathrooms_datamax','options')) { echo get_field('slider_bathrooms_datamax','options'); } else { echo '6'; } ?>'></div>
    </div>
    </div>
    </div>
    </div>
    <div class="bedroom__description"><p><?php
    $repeater = get_field('bathroom_values','options');
    $value = $repeater[0][bathroom_values_text];
    ?>
    <input type="text" data-bathroom-message id="ui-slider__amount113" class="slider-result long_input" value="<?php echo $value; ?>"></p><span><?php _e('(Please round half baths up)', 'themestreet'); ?></span></div>
    <div class="layout layout--small layout--top">
    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r1" name="frequency_id" value="<?php the_field('slider_id_onetimeservice','options'); ?>" class="styled-radiobutton--text"/>
    <label for="r1" class='radio'><div class="verticalize"><?php _e('1 time service', 'themestreet'); ?></div></label>
    <p></p>
    </div>
    </div>

    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r2" name="frequency_id" value="<?php the_field('slider_id_everyweek','options'); ?>" class="styled-radiobutton--text"/>
    <label for="r2" class='radio'><div class="verticalize"><?php _e('Every week', 'themestreet'); ?></div></label>
    <p><?php if(get_field('discount_every_week','options')) { echo get_field('discount_every_week','options'); } else { echo '15'; } ?><?php _e('% Off', 'themestreet'); ?></p>
    </div>

    </div>

    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r3" name="frequency_id" value="<?php the_field('slider_id_everytwoweeks','options'); ?>" class="styled-radiobutton--text" checked />
    <label for="r3" class='radio'><div class="verticalize"><?php _e('Every 2 weeks', 'themestreet'); ?> <span><?php _e('(Most popular)', 'themestreet'); ?></span></div></label>
    <p><?php if(get_field('discount_every_two_weeks','options')) { echo get_field('discount_every_two_weeks','options'); } else { echo '25'; } ?><?php _e('% Off', 'themestreet'); ?></p>
    </div>

    </div>

    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r4" name="frequency_id" value="<?php the_field('slider_id_everyfourweeks','options'); ?>" class="styled-radiobutton--text" />
    <label for="r4" class='radio'><div class="verticalize"><?php _e('Every 4 weeks', 'themestreet'); ?></div></label>
    <p><?php if(get_field('discount_every_four_weeks','options')) { echo get_field('discount_every_four_weeks','options'); } else { echo '35'; } ?><?php _e('% Off', 'themestreet'); ?></p>
    </div>
    </div>
    </div>

    <div class="button-wrap text-center pt">
    <button class="btn btn--primary btn--large"><?php _e('SCHEDULE AN APPOINTMENT', 'themestreet'); ?><?php if (get_field('button_calculator','option')) : ?><span class="price-in-button">$<span id="total-price"></span>/clean</span><?php endif; ?></button>
    </div>

    </form>

    </div>
    </div>
    </div>
    </section>
    <!-- End of .subheader -->

    <?php if (get_field('one_visible')) : ?>
    <!-- Begin of .how-we-work -->
    <section id="how-we-work" class="how-we-work">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('one_visible, one_title, one_boxes, one_button_link, one_button_title');
    } ?>>
    <h2 class="text-center mb pb-"><?php the_field('one_title'); ?></h2>

    <div class="layout layout--large pb">

    <?php if (have_rows('one_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('one_boxes')) : the_row();
    // vars
    $icon = get_sub_field('one_boxes_icon');
    $image = get_sub_field('one_boxes_image');
    $title = get_sub_field('one_boxes_title');
    $description = get_sub_field('one_boxes_description');
    ?>

    <div class="layout__item large-and-up-1/3">
    <div>
    <div class="img-wrap">
    <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
    <div class="icon-wrap">
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $image['alt']; ?>">
    </div>
    </div>
    <div class="text-wrap text-center">
    <h3 class="type-x-huge"><?php echo $title; ?></h3>
    <p><?php echo $description; ?></p>
    </div>
    </div>
    </div>

    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>

    </div>

    <div class="text-center pt+">
    <a href="<?php the_field('one_button_link'); ?>" class="btn btn--primary"><?php the_field('one_button_title'); ?></a>
    </div>
    </div>
    </section>
    <!-- End of .how-we-work -->
    <?php endif; ?>

    <?php if (get_field('two_visible')) : ?>
    <!-- Begin of .trusted-list -->
    <section class="trusted-list">
    <div class="container text-center relative" <?php if (function_exists("live_edit")) {
    live_edit('two_visible, two_title, two_subtitle_one, two_subtitle_two, two_boxes');
    } ?>>
    <h2 class="mb"><?php the_field('two_title'); ?></h2>
    <p class="mb"><?php the_field('two_subtitle_one'); ?></p>
    <p class="mb+"><?php the_field('two_subtitle_two'); ?></p>
    <div class="layout layout--large layout--center">
    <?php if (have_rows('two_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('two_boxes')) : the_row();
    // vars
    $icon = get_sub_field('two_boxes_icon');
    $title = get_sub_field('two_boxes_title');
    ?>
    <div class="layout__item large-and-up-1/5 medium-1/3">
    <div class="img-wrap text-center mb">
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
    </div>
    <p class="type-large text-center color-white"><?php echo $title; ?></p>
    </div>
    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>
    </div>
    </div>
    </section>
    <!-- End of .trusted-list -->
    <?php endif; ?>

    <?php if (get_field('three_visible')) : ?>
    <!-- Begin of .big-phone -->
    <section class="big-phone">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('three_visible, three_phone_image, three_title, three_description, three_apple_link');
    } ?>>
    <div class="flag">
    <div class="flag__img">
    <?php if (get_field('three_phone_image')) : ?>
    <?php
    $picture = get_field('three_phone_image');
    ?>
    <img src="<?php echo $picture['url']; ?>" alt="<?php echo $picture['alt']; ?>">
    <?php endif; ?>
    </div>
    <div class="flag__body">
    <h2><?php the_field('three_title'); ?></h2>
    <p class="type-huge type-light mb"><?php the_field('three_description'); ?></p>
    <?php if (get_field('three_apple_link')) : ?><a href="<?php the_field('three_apple_link'); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/apple-button.png" alt=""></a><?php endif; ?>
    </div>
    </div>
    </div>
    </section>
    <!-- End of .big-phone -->
    <?php endif; ?>

    <?php if (get_field('four_visible')) : ?>
    <!-- Begin of .testimonial -->
    <section class="testimonial"<?php if (get_field('four_background_image')) { ?> style="background-image: url('<?php the_field('four_background_image'); ?>');"<?php } ?>>
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('four_visible, four_background_image, four_title');
    } ?>>
    <h2 class="text-center type-light"><?php the_field('four_title'); ?></h2>
    <div class="testimonial-slider owl-carousel mb">
    <?php
    query_posts(array('post_type' => 'testimonials', 'posts_per_page' => '100'));
    if (have_posts()) :
    ?>
    <?php while (have_posts()) : the_post(); //start of the loop ?>
    <div>
    <div class="testimonial-slider__content">
    <div>
    <p><?php the_field('user_testimonial'); ?></p>
    </div>
    </div>
    <div class="testimonial__img">
    <div class="flag">
    <div class="flag__img">
    <?php
    $image = get_field('user_image');
    $size = 'testimonial-thumb';
    $thumb = $image['sizes'][$size];
    $width = $image['sizes'][$size . '-width'];
    $height = $image['sizes'][$size . '-height'];
    if (!empty($image)):
    ?>
    <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
    <?php endif; ?>
    </div>
    <div class="flag__body">
    <h5 class="color-white type-bold"><?php the_title(); ?></h5>
    <p class="testimonial-slider__name"><?php the_field('user_description'); ?></p>
    </div>
    </div>
    </div>
    </div>
    <?php endwhile; //end of the loop ?><?php endif; ?>
    <?php wp_reset_query(); ?>

    </div>
    </div>
    </section>
    <!-- End of .testimonial -->
    <?php endif; ?>

    <?php if (get_field('five_visible')) : ?>
    <!-- Begin of .trust -->
    <section class="trust">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('five_visible, five_title, five_boxes, five_button_link, five_button_title');
    } ?>>
    <h2 class="text-center type-light mb pb-"><?php the_field('five_title'); ?></h2>

    <div class="layout mb+">
    <?php if (have_rows('five_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('five_boxes')) : the_row();
    // vars
    $icon = get_sub_field('five_boxes_icon');
    $title = get_sub_field('five_boxes_title');
    $description = get_sub_field('five_boxes_description');
    ?>
    <div class="layout__item large-and-up-1/3 text-center">
    <div>
    <div class="icon-wrap">
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
    </div>
    <h3><?php echo $title; ?></h3>
    <p><?php echo $description; ?></p>
    </div>
    </div>
    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>
    </div>
    <div class="text-center">
    <a href="<?php the_field('five_button_link'); ?>" class="btn btn--primary btn--transparent btn--small"><?php the_field('five_button_title'); ?></a>
    </div>
    </div>
    </section>
    <!-- End of .trust -->
    <?php endif; ?>

    <?php if (get_field('six_visible')) : ?>
    <!-- Begin of .book-appointment -->
    <section class="book-appointment">
    <div class="container text-center relative" <?php if (function_exists("live_edit")) {
    live_edit('six_visible, six_title, six_link, six_placeholder');
    } ?>>
    <h2 class="type-uppercase h3"><?php the_field('six_title'); ?></h2>
    <form action="<?php the_field('six_link'); ?>" method="get">
    <label><input name="zip" type="text" class="input input--primary" placeholder="<?php the_field('six_placeholder'); ?>"></label>
    <button class="btn btn--primary type-bold"><?php _e('BOOK A CLEANING NOW', 'themestreet'); ?></button>
    </form>
    </div>
    </section>
    <!-- End of .book-appointment -->
    <?php endif; ?>

    <?php if (get_field('seven_visible')) : ?>
    <!-- Begin of .partners -->
    <section class="partners">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('seven_visible, seven_boxes');
    } ?>>
    <div>
    <div class="layout layout--center layout--middle">
    <?php if (have_rows('seven_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('seven_boxes')) : the_row();
    // vars
    $icon = get_sub_field('seven_boxes_banner');
    $link = get_sub_field('seven_boxes_link');
    ?>
    <div class="layout__item large-and-up-1/6 medium-1/3 text-center">
    <?php if (get_sub_field('seven_boxes_link')) : ?><a href="<?php echo $link; ?>"><?php endif; ?>
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
    <?php if (get_sub_field('seven_boxes_link')) : ?></a><?php endif; ?>
    </div>
    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    </div>
    </div>
    </div>
    </section>
    <!-- End of .partners -->
    <?php endif; ?>

    </main>

    <?php
    endwhile;
    endif;
    ?>

    <?php get_footer(); ?>

    Thanks for sharing the code, it seems that you are editing the code outside the <script> tags -> https://prnt.sc/8Nx9Boq8U1vz

    The proposed fix was supposed to be applied only in the <script> </script> part, between line 17 and 117. Restore the file to the state before you made the changes and then replace the code in the <script> area.

    <script>
    var bedroom_values = false;
    var bathroom_values = false;

    jQuery(document).ready(function() {
    // Slider front start
    jQuery('#ui-slider1').slider({
    orientation: "horizontal",
    animate: "fast",
    range: "min",
    min: 1,
    step: 1,
    max: 6,
    value: 1,
    slide: function(e, t) {
    var input = jQuery('input[name="service_id"]');
    switch (t.value) {
    default:
    input.val(1);
    }

    for (var i = 0; i < bedroom_values.length; i++) {
    if (input.val() == bedroom_values[i].slider_l27_value) {
    jQuery('[data-bedroom-message]').val(bedroom_values[i].bedroom_values_text);
    }
    }

    jQuery('#ui-slider__amount1').val(t.value);
    }
    });

    jQuery('#ui-slider2').slider({
    orientation: "horizontal",
    animate: "fast",
    range: "min",
    min: 1,
    step: 1,
    max: 6,
    value: 1,
    slide: function(e, t) {
    var input = jQuery('input[name="pricing_param_quantity"]');
    switch (t.value) {
    default:
    input.val(1);
    }

    for (var i = 0; i < bathroom_values.length; i++) {
    if (input.val() == bathroom_values[i].slider_bathroom_l27_value) {
    jQuery('[data-bathroom-message]').val(bathroom_values[i].bathroom_values_text);
    }
    }

    jQuery('#ui-slider__amount2').val(t.value);
    }
    });
    });

    // Slider counter and price update
    var BEDROOM_RATES = {};
    var PER_BATHROOM = 25;

    jQuery(window).ready(function() {
    updatePrice();
    jQuery('input[type=radio]').on('change', updatePrice);
    jQuery('#ui-slider1, #ui-slider2').on('slidechange', updatePrice);
    });

    function updatePrice() {
    var perc_off = 0.0,
    bedrooms = jQuery('#ui-slider1').slider('option', 'value'),
    bathrooms = jQuery('#ui-slider2').slider('option', 'value'),
    freq_id = jQuery('input[type=radio]:checked').attr('id'),
    total_price = 0;

    total_price = BEDROOM_RATES['b' + bedrooms];
    total_price += bathrooms * PER_BATHROOM;

    if (freq_id == 'r1') {
    // one time
    perc_off = 0;
    } else if (freq_id == 'r2') {
    // every week
    perc_off = 0.2;
    } else if (freq_id == 'r3') {
    // every two weeks
    perc_off = 0.15;
    } else if (freq_id == 'r4') {
    // every four weeks
    perc_off = 0.1;
    }

    // Subtract frequency discount
    total_price *= (1 - perc_off);
    // Set total price on button
    jQuery("#total-price").html(parseFloat(total_price).toFixed(2));
    }

    jQuery(document).on('change', '#ui-slider__amount1', function(e) {
    // Handle change event
    });
    </script>

    Try it like that, and let’s see what happens next.

    Kind Regards.

    Thread Starter dsturner

    (@dsturner)

    Oh, no. I knew I would mess this up.

    Okay, the next <script> tag after Line 17 is Line 240. I tried to paste the new code in that section, and, wouldn’t you know, I am right back where I started. I received the following error:

    “Your PHP code changes were not applied due to an error on line 126 of file wp-content/themes/bluedream/page-homepage.php. Please fix and try saving again.

    Uncaught Error: Undefined constant “slider_l27_value” in wp-content/themes/bluedream/page-homepage.php:126

    Stack trace:

    #0 wp-includes/template-loader.php(106): include()

    #1 wp-blog-header.php(19): require_once(‘/home2/bestfiv4…’)

    #2 index.php(17): require(‘/home2/bestfiv4…’)

    #3 {main}

    thrown”

    SO, I tried to wrap the slider. No go. I still have errors.

    Here’s the page-homepage.php full code again:

        <main>
    
            <!-- Begin of  .subheader -->
            <section class="subheader pv0"<?php if (get_field('subheader_background')) : ?> style="background-image: url('<?php the_field('subheader_background'); ?>')"<?php endif; ?>>
                <div class="container">
                    <div class="text-center mb+">
                        <h2 class="color-white type-normal relative" <?php if (function_exists("live_edit")) {
            live_edit('subheader_background, subheader_title, subheader_subtitle, subheader_form_action');
        } ?>><?php the_field('subheader_title'); ?></h2>
        <?php if (get_field('subheader_subtitle')) : ?><p class="color-white type-x-huge type-semibold"><?php the_field('subheader_subtitle'); ?></p><?php endif; ?>
                    </div>
                    <div class="layout layout--large layout--center">
                        <div class="layout__item mb0">
                            <script>
                                var bedroom_values = <?php echo json_encode( get_field( 'bedroom_values', 'options' ) ); ?>;
                                //console.log( bedroom_values );
                                var bathroom_values = <?php echo json_encode( get_field( 'bathroom_values', 'options' ) ); ?>;
                                //console.log( bathroom_values );
                                $( document ).ready( function( ) {
                                // slider front start
                                $( '#ui-slider1' ).slider( {
                                orientation: "horizontal",
                                    animate: "fast",
                                    range: "min",
                                    min: 1,
                                    step: 1,
                                    max: <?php
                                    if ( get_field( 'slider_bedrooms_datamax', 'options' ) ) {
                                        echo get_field( 'slider_bedrooms_datamax', 'options' );
                                    } else {
                                        echo '6';
                                    }
                                    ?>,
                                    value: 1,
                                    slide: function ( e, t ) {
    
                                    var input = $( 'input[name="service_id"]' );
                                    switch ( t.value ) {
    
                                    <?php if ( have_rows( 'bedroom_values', 'options' ) ) : $i = 1; ?>
                                        <?php
                                        while ( have_rows( 'bedroom_values', 'options' ) ) : the_row();
                                            // vars
                                            $bedroom  = get_sub_field( 'slider_room_number', 'options' );
                                            $bathroom = get_sub_field( 'slider_l27_value', 'options' );
                                            ?>
                                                case <?php echo $bedroom; ?>:
                                                    input.val(<?php echo $bathroom; ?> )
                                                    break;
                                            <?php $i++; ?>
                                        <?php endwhile; ?>
                                    <?php endif; ?>
    
                                    default:
                                        input.val( 1 )
                                    }
    
                                    for ( var i = 0; i < bedroom_values.length; i++ ) {
    
                                    if ( input.val( ) == bedroom_values[i].slider_l27_value ) {
    
                                    $( '[data-bedroom-message]' ).val( bedroom_values[i].bedroom_values_text );
                                    }
    
    
                                    }
    
                                    $( '#ui-slider__amount1' ).val( t.value );
                                    }
    
    
                                } );
                                $( '#ui-slider2' ).slider( {
                                orientation: "horizontal",
                                    animate: "fast",
                                    range: "min",
                                    min: 1,
                                    step: 1,
                                    max: <?php
                                    if ( get_field( 'slider_bathrooms_datamax', 'options' ) ) {
                                        echo get_field( 'slider_bathrooms_datamax', 'options' );
                                    } else {
                                        echo '6';
                                    }
                                    ?>,
                                    value: 1,
                                    slide: function ( e, t ) {
    
                                    var input = $( 'input[name="pricing_param_quantity"]' );
                                    switch ( t.value ) {
    
                                    <?php if ( have_rows( 'bathroom_values', 'options' ) ) : $i = 1; ?>
                                        <?php
                                        while ( have_rows( 'bathroom_values', 'options' ) ) : the_row();
                                            // vars
                                            $bedroom  = get_sub_field( 'slider_bathroom_number', 'options' );
                                            $bathroom = get_sub_field( 'slider_bathroom_l27_value', 'options' );
                                            ?>
    
                                            case <?php echo $bedroom; ?>:
                                                input.val(<?php echo $bathroom; ?> )
                                                break;
                                            <?php $i++; ?>
                                        <?php endwhile; ?>
                                    <?php endif; ?>
    
                                    default:
                                        input.val( 1 )
                                    }
    
                                    for ( var i = 0; i < bathroom_values.length; i++ ) {
    
                                    if ( input.val( ) == bathroom_values[i].slider_bathroom_l27_value ) {
    
                                    $( '[data-bathroom-message]' ).val( bathroom_values[i].bathroom_values_text );
                                    }
    
                                    }
    
                                    $( '#ui-slider__amount2' ).val( t.value );
                                    }
                                } );
                                } );
                                // slider counter
    
                                var BEDROOM_RATES = { <?php if ( have_rows( 'bedroom_values', 'options' ) ) : $i = 1; ?><?php
                                    while ( have_rows( 'bedroom_values', 'options' ) ) : the_row();
                                        // vars
                                        $number = get_sub_field( 'slider_room_number', 'options' );
                                        $price  = get_sub_field( 'slider_bedroom_price', 'options' );
                                        ?>
                                        <?php echo 'b'; ?><?php echo $number; ?>: <?php echo $price; ?>,
                                        <?php $i++; ?>
                                    <?php endwhile; ?>
                                <?php endif; ?> };
                                                        var PER_BATHROOM = <?php
                                if ( get_field( 'bathroom_price', 'options' ) ) {
                                    echo get_field( 'bathroom_price', 'options' );
                                } else {
                                    echo '30';
                                }
                                ?>;
                                $( window ).ready( function ( ) {
                                updatePrice( );
                                $( 'input[type=radio]' ).on( 'change', updatePrice );
                                $( '#ui-slider1, #ui-slider2' ).on( 'slidechange', updatePrice );
                                } ); // doc ready
    
                                function updatePrice( ) {
                                var perc_off = 0.0,
                                    bedrooms = $( '#ui-slider1' ).slider( 'option', 'value' ),
                                    bathrooms = $( '#ui-slider2' ).slider( 'option', 'value' ),
                                    freq_id = $( 'input[type=radio]:checked' ).attr( 'id' ),
                                    total_price = 0;
                                total_price = BEDROOM_RATES['b' + bedrooms];
                                total_price += bathrooms * PER_BATHROOM;
                                if ( freq_id == 'r1' ) {
                                // one time
                                <?php
                                if ( get_field( 'discount_one_time', 'options' ) ) {
                                    $percentage = get_field( 'discount_one_time', 'options' );
                                    $decimal    = $percentage / 100;
    
                                    echo 'perc_off = ' . $decimal;
                                } else {
                                    echo 'perc_off = 0';
                                }
                                ?>
    
                                }
                                else if ( freq_id == 'r2' ) {
                                // every week
                                <?php
                                if ( get_field( 'discount_every_week', 'options' ) ) {
                                    $percentage = get_field( 'discount_every_week', 'options' );
                                    $decimal    = $percentage / 100;
    
                                    echo 'perc_off = ' . $decimal;
                                } else {
                                    echo 'perc_off = 15';
                                }
                                ?>
    
                                }
                                else if ( freq_id == 'r3' ) {
                                // every two weeks
                                <?php
                                if ( get_field( 'discount_every_two_weeks', 'options' ) ) {
                                    $percentage = get_field( 'discount_every_two_weeks', 'options' );
                                    $decimal    = $percentage / 100;
    
                                    echo 'perc_off = ' . $decimal;
                                } else {
                                    echo 'perc_off = 25';
                                }
                                ?>
                                }
                                else if ( freq_id == 'r4' ) {
                                // every four weeks
                                <?php
                                if ( get_field( 'discount_every_four_weeks', 'options' ) ) {
                                    $percentage = get_field( 'discount_every_four_weeks', 'options' );
                                    $decimal    = $percentage / 100;
    
                                    echo 'perc_off = ' . $decimal;
                                } else {
                                    echo 'perc_off = 35';
                                }
                                ?>
                                }
    
                                <?php
                                if ( get_field( 'tax_percentage', 'options' ) ) :
                                    $tax = get_field( 'tax_percentage', 'options' );
                                    $tax = $tax / 100;
                                    $tax = $tax + 1;
                                    ?>
    
                                    // if tax, show price with tax
                                    total_price = total_price *<?php echo $tax; ?>;
                                <?php endif; ?>
    
                                // subtract frequency discount
                                total_price *= ( 1 - perc_off );
                                // set total price on button
                                $( "#total-price" ).html( parseFloat( total_price ).toFixed( 2 ) );
                                }
    
    
                                $( document ).on( 'change', '#ui-slider__amount1', function ( e ) {
                                //console.log( $( this ).val( ) );
                                } );
                                // } );
    
    
                                // slider front end
                            </script>
                            <form action="<?php the_field('subheader_form_action'); ?>" method="get">
                                <div class="flag-wrap">
                                    <div class="flag flag--small mb pb--">
                                        <div class="flag__img">
                                            <p class="slider-result-wrap"><?php _e('Bedrooms', 'themestreet'); ?>:
                                                <input type="text" id="ui-slider__amount1" class="slider-result" value="1">
                                                <?php
                                                $repeater = get_field('bedroom_values','options');
                                                $value = $repeater[0][slider_l27_value];
                                                ?>
                                                <input id="service_id" name="service_id" type="hidden" value="<?php echo $value; ?>">
                                            </p>
                                        </div>
                                        <div class="flag__body">
                                            <div class="ui-slider-wrap">
                                                <div id="ui-slider1" data-max='<?php if(get_field('slider_bedrooms_datamax','options')) { echo get_field('slider_bedrooms_datamax','options'); } else { echo '6'; } ?>'></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="bedroom__description"><p>
                                                <?php
                                                $repeater = get_field('bedroom_values','options');
                                                $value = $repeater[0][bedroom_values_text];
                                                ?>
                                        <input type="text" data-bedroom-message id="ui-slider__amount112" class="slider-result long_input" value="<?php echo $value; ?>">
                                </p><span><?php _e('(Kitchen and living room included)', 'themestreet'); ?></span></div>
                                <div class="flag-wrap">
                                    <div class="flag flag--small mb">
                                        <div class="flag__img">
                                            <p class="slider-result-wrap"><?php _e('Bathrooms', 'themestreet'); ?>:
                                                <input type="text" id="ui-slider__amount2" class="slider-result" value="1">
                                                <?php
                                                $repeater = get_field('bathroom_values','options');
                                                $value = $repeater[0][slider_bathroom_l27_value];
                                                ?>
                                                <input id="pricing_param_quantity" name="pricing_param_quantity" type="hidden" value="<?php echo $value; ?>">
                                            </p>
                                        </div>
                                        <div class="flag__body">
                                            <div class="ui-slider-wrap">
                                                <div id="ui-slider2" data-max='<?php if(get_field('slider_bathrooms_datamax','options')) { echo get_field('slider_bathrooms_datamax','options'); } else { echo '6'; } ?>'></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="bedroom__description"><p><?php
                                                $repeater = get_field('bathroom_values','options');
                                                $value = $repeater[0][bathroom_values_text];
                                                ?>
                                        <input type="text" data-bathroom-message id="ui-slider__amount113" class="slider-result long_input" value="<?php echo $value; ?>"></p><span><?php _e('(Please round half baths up)', 'themestreet'); ?></span></div>
                                <div class="layout layout--small layout--top">
                                    <div class="layout__item large-and-up-1/4 1/2">
                                        <div class="radio_wrap">
                                            <input type="radio" id="r1" name="frequency_id" value="<?php the_field('slider_id_onetimeservice','options'); ?>" class="styled-radiobutton--text"/>
                                            <label for="r1" class='radio'><div class="verticalize"><?php _e('1 time service', 'themestreet'); ?></div></label>
                                            <p></p>
                                        </div>
                                    </div>
    
                                    <div class="layout__item large-and-up-1/4 1/2">
                                        <div class="radio_wrap">
                                            <input type="radio" id="r2" name="frequency_id" value="<?php the_field('slider_id_everyweek','options'); ?>" class="styled-radiobutton--text"/>
                                            <label for="r2" class='radio'><div class="verticalize"><?php _e('Every week', 'themestreet'); ?></div></label>
                                            <p><?php if(get_field('discount_every_week','options')) { echo get_field('discount_every_week','options'); } else { echo '15'; } ?><?php _e('% Off', 'themestreet'); ?></p>
                                        </div>
    
                                    </div>
    
                                    <div class="layout__item large-and-up-1/4 1/2">
                                        <div class="radio_wrap">
                                            <input type="radio" id="r3" name="frequency_id" value="<?php the_field('slider_id_everytwoweeks','options'); ?>" class="styled-radiobutton--text" checked />
                                            <label for="r3" class='radio'><div class="verticalize"><?php _e('Every 2 weeks', 'themestreet'); ?> <span><?php _e('(Most popular)', 'themestreet'); ?></span></div></label>
                                            <p><?php if(get_field('discount_every_two_weeks','options')) { echo get_field('discount_every_two_weeks','options'); } else { echo '25'; } ?><?php _e('% Off', 'themestreet'); ?></p>
                                        </div>
    
                                    </div>
    
                                    <div class="layout__item large-and-up-1/4 1/2">
                                        <div class="radio_wrap">
                                            <input type="radio" id="r4" name="frequency_id" value="<?php the_field('slider_id_everyfourweeks','options'); ?>" class="styled-radiobutton--text"  />
                                            <label for="r4" class='radio'><div class="verticalize"><?php _e('Every 4 weeks', 'themestreet'); ?></div></label>
                                            <p><?php if(get_field('discount_every_four_weeks','options')) { echo get_field('discount_every_four_weeks','options'); } else { echo '35'; } ?><?php _e('% Off', 'themestreet'); ?></p>
                                        </div>
                                    </div>
                                </div>
    
                                <div class="button-wrap text-center pt">
                                    <button class="btn btn--primary btn--large"><?php _e('SCHEDULE AN APPOINTMENT', 'themestreet'); ?><?php if (get_field('button_calculator','option')) : ?><span class="price-in-button">$<span id="total-price"></span>/clean</span><?php endif; ?></button>
                                </div>
    
                            </form>
    
                        </div>
                    </div>
                </div>
            </section>
            <!-- End of .subheader  -->
    
        <?php if (get_field('one_visible')) : ?>
                <!-- Begin of  .how-we-work -->
                <section id="how-we-work" class="how-we-work">
                    <div class="container relative"  <?php if (function_exists("live_edit")) {
                live_edit('one_visible, one_title, one_boxes, one_button_link, one_button_title');
            } ?>>
                        <h2 class="text-center mb pb-"><?php the_field('one_title'); ?></h2>
    
                        <div class="layout layout--large pb">
    
                            <?php if (have_rows('one_boxes')) : $i = 1; ?>
                                <?php
                                while (have_rows('one_boxes')) : the_row();
                                    // vars
                                    $icon = get_sub_field('one_boxes_icon');
                                    $image = get_sub_field('one_boxes_image');
                                    $title = get_sub_field('one_boxes_title');
                                    $description = get_sub_field('one_boxes_description');
                                    ?>
    
                                    <div class="layout__item large-and-up-1/3">
                                        <div>
                                            <div class="img-wrap">
                                                <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
                                                <div class="icon-wrap">
                                                    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $image['alt']; ?>">
                                                </div>
                                            </div>
                                            <div class="text-wrap text-center">
                                                <h3 class="type-x-huge"><?php echo $title; ?></h3>
                                                <p><?php echo $description; ?></p>
                                            </div>
                                        </div>
                                    </div>
    
                    <?php $i++; ?>
                <?php endwhile; ?>
            <?php endif; ?>
            <?php wp_reset_query(); ?>
    
                        </div>
    
                        <div class="text-center pt+">
                            <a href="<?php the_field('one_button_link'); ?>" class="btn btn--primary"><?php the_field('one_button_title'); ?></a>
                        </div>
                    </div>
                </section>
                <!-- End of .how-we-work  -->
        <?php endif; ?>
    
        <?php if (get_field('two_visible')) : ?>
                <!-- Begin of  .trusted-list -->
                <section class="trusted-list">
                    <div class="container text-center relative" <?php if (function_exists("live_edit")) {
                live_edit('two_visible, two_title, two_subtitle_one, two_subtitle_two, two_boxes');
            } ?>>
                        <h2 class="mb"><?php the_field('two_title'); ?></h2>
                        <p class="mb"><?php the_field('two_subtitle_one'); ?></p>
                        <p class="mb+"><?php the_field('two_subtitle_two'); ?></p>
                        <div class="layout layout--large layout--center">
                            <?php if (have_rows('two_boxes')) : $i = 1; ?>
                <?php
                while (have_rows('two_boxes')) : the_row();
                    // vars
                    $icon = get_sub_field('two_boxes_icon');
                    $title = get_sub_field('two_boxes_title');
                    ?>
                                    <div class="layout__item large-and-up-1/5 medium-1/3">
                                        <div class="img-wrap text-center mb">
                                            <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
                                        </div>
                                        <p class="type-large text-center color-white"><?php echo $title; ?></p>
                                    </div>
                    <?php $i++; ?>
                    <?php endwhile; ?>
                <?php endif; ?>
                <?php wp_reset_query(); ?>
                        </div>
                    </div>
                </section>
                <!-- End of .trusted-list  -->
        <?php endif; ?>
    
                            <?php if (get_field('three_visible')) : ?>
                <!-- Begin of  .big-phone -->
                <section class="big-phone">
                    <div class="container relative" <?php if (function_exists("live_edit")) {
                        live_edit('three_visible, three_phone_image, three_title, three_description, three_apple_link');
                    } ?>>
                        <div class="flag">
                            <div class="flag__img">
            <?php if (get_field('three_phone_image')) : ?>
                                    <?php
                                    $picture = get_field('three_phone_image');
                                    ?>
                                    <img src="<?php echo $picture['url']; ?>" alt="<?php echo $picture['alt']; ?>">
            <?php endif; ?>
                            </div>
                            <div class="flag__body">
                                <h2><?php the_field('three_title'); ?></h2>
                                <p class="type-huge type-light mb"><?php the_field('three_description'); ?></p>
                <?php if (get_field('three_apple_link')) : ?><a href="<?php the_field('three_apple_link'); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/apple-button.png" alt=""></a><?php endif; ?>
                            </div>
                        </div>
                    </div>
                </section>
                <!-- End of .big-phone  -->
                        <?php endif; ?>
    
                        <?php if (get_field('four_visible')) : ?>
                <!-- Begin of  .testimonial -->
                <section class="testimonial"<?php if (get_field('four_background_image')) { ?> style="background-image: url('<?php the_field('four_background_image'); ?>');"<?php } ?>>
                    <div class="container relative" <?php if (function_exists("live_edit")) {
                    live_edit('four_visible, four_background_image, four_title');
                } ?>>
                        <h2 class="text-center type-light"><?php the_field('four_title'); ?></h2>
                        <div class="testimonial-slider owl-carousel mb">
            <?php
            query_posts(array('post_type' => 'testimonials', 'posts_per_page' => '100'));
            if (have_posts()) :
                ?>
                                                <?php while (have_posts()) : the_post(); //start of the loop  ?>
                                    <div>
                                        <div class="testimonial-slider__content">
                                            <div>
                                                <p><?php the_field('user_testimonial'); ?></p>
                                            </div>
                                        </div>
                                        <div class="testimonial__img">
                                            <div class="flag">
                                                <div class="flag__img">
                    <?php
                    $image = get_field('user_image');
                    $size = 'testimonial-thumb';
                    $thumb = $image['sizes'][$size];
                    $width = $image['sizes'][$size . '-width'];
                    $height = $image['sizes'][$size . '-height'];
                    if (!empty($image)):
                        ?>
                                                        <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
                                    <?php endif; ?>
                                                </div>
                                                <div class="flag__body">
                                                    <h5 class="color-white type-bold"><?php the_title(); ?></h5>
                                                    <p class="testimonial-slider__name"><?php the_field('user_description'); ?></p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                <?php endwhile; //end of the loop  ?><?php endif; ?>
            <?php wp_reset_query(); ?>
    
                        </div>
                    </div>
                </section>
                <!-- End of .testimonial  -->
                        <?php endif; ?>
    
                        <?php if (get_field('five_visible')) : ?>
                <!-- Begin of  .trust -->
                <section class="trust">
                    <div class="container relative" <?php if (function_exists("live_edit")) {
                    live_edit('five_visible, five_title, five_boxes, five_button_link, five_button_title');
                } ?>>
                        <h2 class="text-center type-light mb pb-"><?php the_field('five_title'); ?></h2>
    
                        <div class="layout mb+">
            <?php if (have_rows('five_boxes')) : $i = 1; ?>
                <?php
                while (have_rows('five_boxes')) : the_row();
                    // vars
                    $icon = get_sub_field('five_boxes_icon');
                    $title = get_sub_field('five_boxes_title');
                    $description = get_sub_field('five_boxes_description');
                    ?>
                                    <div class="layout__item large-and-up-1/3 text-center">
                                        <div>
                                            <div class="icon-wrap">
                                                <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
                                            </div>
                                            <h3><?php echo $title; ?></h3>
                                            <p><?php echo $description; ?></p>
                                        </div>
                                    </div>
                        <?php $i++; ?>
                    <?php endwhile; ?>
            <?php endif; ?>
            <?php wp_reset_query(); ?>
                        </div>
                        <div class="text-center">
                            <a href="<?php the_field('five_button_link'); ?>" class="btn btn--primary btn--transparent btn--small"><?php the_field('five_button_title'); ?></a>
                        </div>
                    </div>
                </section>
                <!-- End of .trust  -->
        <?php endif; ?>
    
            <?php if (get_field('six_visible')) : ?>
                <!-- Begin of  .book-appointment -->
                <section class="book-appointment">
                    <div class="container text-center relative" <?php if (function_exists("live_edit")) {
                live_edit('six_visible, six_title, six_link, six_placeholder');
            } ?>>
                        <h2 class="type-uppercase h3"><?php the_field('six_title'); ?></h2>
                        <form action="<?php the_field('six_link'); ?>" method="get">
                            <label><input name="zip" type="text" class="input input--primary" placeholder="<?php the_field('six_placeholder'); ?>"></label>
                            <button class="btn btn--primary type-bold"><?php _e('BOOK A CLEANING NOW', 'themestreet'); ?></button>
                        </form>
                    </div>
                </section>
                <!-- End of .book-appointment  -->
                            <?php endif; ?>
    
                                <?php if (get_field('seven_visible')) : ?>
                <!-- Begin of  .partners -->
                <section class="partners">
                    <div class="container relative"  <?php if (function_exists("live_edit")) {
                            live_edit('seven_visible, seven_boxes');
                        } ?>>
                        <div>
                            <div class="layout layout--center layout--middle">
            <?php if (have_rows('seven_boxes')) : $i = 1; ?>
                <?php
                while (have_rows('seven_boxes')) : the_row();
                    // vars
                    $icon = get_sub_field('seven_boxes_banner');
                    $link = get_sub_field('seven_boxes_link');
                    ?>
                                        <div class="layout__item large-and-up-1/6 medium-1/3 text-center">
                    <?php if (get_sub_field('seven_boxes_link')) : ?><a href="<?php echo $link; ?>"><?php endif; ?>
                                                <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
                    <?php if (get_sub_field('seven_boxes_link')) : ?></a><?php endif; ?>
                                        </div>
                    <?php $i++; ?>
                <?php endwhile; ?>
            <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </section>
                <!-- End of .partners  -->
        <?php endif; ?>
    
        </main>
    
    <?php
    endwhile;

    endif;
    ?>

    <?php get_footer(); ?>

    Hello there, try this:

      <main>

    <!-- Begin of .subheader -->
    <section class="subheader pv0"<?php if (get_field('subheader_background')) : ?> style="background-image: url('<?php the_field('subheader_background'); ?>')"<?php endif; ?>>
    <div class="container">
    <div class="text-center mb+">
    <h2 class="color-white type-normal relative" <?php if (function_exists("live_edit")) {
    live_edit('subheader_background, subheader_title, subheader_subtitle, subheader_form_action');
    } ?>><?php the_field('subheader_title'); ?></h2>
    <?php if (get_field('subheader_subtitle')) : ?><p class="color-white type-x-huge type-semibold"><?php the_field('subheader_subtitle'); ?></p><?php endif; ?>
    </div>
    <div class="layout layout--large layout--center">
    <div class="layout__item mb0">
    <script>
    var bedroom_values = <?php echo json_encode(get_field('bedroom_values', 'options')); ?>;
    var bathroom_values = <?php echo json_encode(get_field('bathroom_values', 'options')); ?>;

    jQuery(document).ready(function() {
    // slider front start
    jQuery('#ui-slider1').slider({
    orientation: "horizontal",
    animate: "fast",
    range: "min",
    min: 1,
    step: 1,
    max: <?php
    if (get_field('slider_bedrooms_datamax', 'options')) {
    echo get_field('slider_bedrooms_datamax', 'options');
    } else {
    echo '6';
    }
    ?>,
    value: 1,
    slide: function(e, t) {
    var input = jQuery('input[name="service_id"]');
    switch (t.value) {
    <?php if (have_rows('bedroom_values', 'options')) : $i = 1; ?>
    <?php while (have_rows('bedroom_values', 'options')) : the_row();
    $bedroom = get_sub_field('slider_room_number', 'options');
    $bathroom = get_sub_field('slider_l27_value', 'options');
    ?>
    case <?php echo $bedroom; ?>:
    input.val(<?php echo $bathroom; ?>);
    break;
    <?php $i++; endwhile; ?>
    <?php endif; ?>

    default:
    input.val(1);
    }

    for (var i = 0; i < bedroom_values.length; i++) {
    if (input.val() == bedroom_values[i].slider_l27_value) {
    jQuery('[data-bedroom-message]').val(bedroom_values[i].bedroom_values_text);
    }
    }

    jQuery('#ui-slider__amount1').val(t.value);
    }
    });

    jQuery('#ui-slider2').slider({
    orientation: "horizontal",
    animate: "fast",
    range: "min",
    min: 1,
    step: 1,
    max: <?php
    if (get_field('slider_bathrooms_datamax', 'options')) {
    echo get_field('slider_bathrooms_datamax', 'options');
    } else {
    echo '6';
    }
    ?>,
    value: 1,
    slide: function(e, t) {
    var input = jQuery('input[name="pricing_param_quantity"]');
    switch (t.value) {
    <?php if (have_rows('bathroom_values', 'options')) : $i = 1; ?>
    <?php while (have_rows('bathroom_values', 'options')) : the_row();
    $bedroom = get_sub_field('slider_bathroom_number', 'options');
    $bathroom = get_sub_field('slider_bathroom_l27_value', 'options');
    ?>
    case <?php echo $bedroom; ?>:
    input.val(<?php echo $bathroom; ?>);
    break;
    <?php $i++; endwhile; ?>
    <?php endif; ?>

    default:
    input.val(1);
    }

    for (var i = 0; i < bathroom_values.length; i++) {
    if (input.val() == bathroom_values[i].slider_bathroom_l27_value) {
    jQuery('[data-bathroom-message]').val(bathroom_values[i].bathroom_values_text);
    }
    }

    jQuery('#ui-slider__amount2').val(t.value);
    }
    });
    });

    var BEDROOM_RATES = {
    <?php if (have_rows('bedroom_values', 'options')) : $i = 1; ?>
    <?php while (have_rows('bedroom_values', 'options')) : the_row();
    $number = get_sub_field('slider_room_number', 'options');
    $price = get_sub_field('slider_bedroom_price', 'options');
    ?>
    <?php echo 'b' . $number; ?>: <?php echo $price; ?>,
    <?php $i++; endwhile; ?>
    <?php endif; ?>
    };

    var PER_BATHROOM = <?php
    if (get_field('bathroom_price', 'options')) {
    echo get_field('bathroom_price', 'options');
    } else {
    echo '30';
    }
    ?>;

    jQuery(window).ready(function() {
    updatePrice();
    jQuery('input[type=radio]').on('change', updatePrice);
    jQuery('#ui-slider1, #ui-slider2').on('slidechange', updatePrice);
    });

    function updatePrice() {
    var perc_off = 0.0,
    bedrooms = jQuery('#ui-slider1').slider('option', 'value'),
    bathrooms = jQuery('#ui-slider2').slider('option', 'value'),
    freq_id = jQuery('input[type=radio]:checked').attr('id'),
    total_price = 0;

    total_price = BEDROOM_RATES['b' + bedrooms];
    total_price += bathrooms * PER_BATHROOM;

    if (freq_id == 'r1') {
    // one time
    <?php
    if (get_field('discount_one_time', 'options')) {
    $percentage = get_field('discount_one_time', 'options');
    $decimal = $percentage / 100;

    echo 'perc_off = ' . $decimal;
    } else {
    echo 'perc_off = 0';
    }
    ?>
    } else if (freq_id == 'r2') {
    // every week
    <?php
    if (get_field('discount_every_week', 'options')) {
    $percentage = get_field('discount_every_week', 'options');
    $decimal = $percentage / 100;

    echo 'perc_off = ' . $decimal;
    } else {
    echo 'perc_off = 0.15';
    }
    ?>
    } else if (freq_id == 'r3') {
    // every two weeks
    <?php
    if (get_field('discount_every_two_weeks', 'options')) {
    $percentage = get_field('discount_every_two_weeks', 'options');
    $decimal = $percentage / 100;

    echo 'perc_off = ' . $decimal;
    } else {
    echo 'perc_off = 0.25';
    }
    ?>
    } else if (freq_id == 'r4') {
    // every four weeks
    <?php
    if (get_field('discount_every_four_weeks', 'options')) {
    $percentage = get_field('discount_every_four_weeks', 'options');
    $decimal = $percentage / 100;

    echo 'perc_off = ' . $decimal;
    } else {
    echo 'perc_off = 0.35';
    }
    ?>
    }

    <?php
    if (get_field('tax_percentage', 'options')) :
    $tax = get_field('tax_percentage', 'options');
    $tax = $tax / 100;
    $tax = $tax + 1;
    ?>

    // if tax, show price with tax
    total_price = total_price *<?php echo $tax; ?>;
    <?php endif; ?>

    // subtract frequency discount
    total_price *= (1 - perc_off);
    // set total price on button
    jQuery("#total-price").html(parseFloat(total_price).toFixed(2));
    }

    jQuery(document).on('change', '#ui-slider__amount1', function(e) {
    // console.log(jQuery(this).val());
    });
    </script>
    <form action="<?php the_field('subheader_form_action'); ?>" method="get">
    <div class="flag-wrap">
    <div class="flag flag--small mb pb--">
    <div class="flag__img">
    <p class="slider-result-wrap"><?php _e('Bedrooms', 'themestreet'); ?>:
    <input type="text" id="ui-slider__amount1" class="slider-result" value="1">
    <?php
    $repeater = get_field('bedroom_values','options');
    $value = $repeater[0][slider_l27_value];
    ?>
    <input id="service_id" name="service_id" type="hidden" value="<?php echo $value; ?>">
    </p>
    </div>
    <div class="flag__body">
    <div class="ui-slider-wrap">
    <div id="ui-slider1" data-max='<?php if(get_field('slider_bedrooms_datamax','options')) { echo get_field('slider_bedrooms_datamax','options'); } else { echo '6'; } ?>'></div>
    </div>
    </div>
    </div>
    </div>
    <div class="bedroom__description"><p>
    <?php
    $repeater = get_field('bedroom_values','options');
    $value = $repeater[0][bedroom_values_text];
    ?>
    <input type="text" data-bedroom-message id="ui-slider__amount112" class="slider-result long_input" value="<?php echo $value; ?>">
    </p><span><?php _e('(Kitchen and living room included)', 'themestreet'); ?></span></div>
    <div class="flag-wrap">
    <div class="flag flag--small mb">
    <div class="flag__img">
    <p class="slider-result-wrap"><?php _e('Bathrooms', 'themestreet'); ?>:
    <input type="text" id="ui-slider__amount2" class="slider-result" value="1">
    <?php
    $repeater = get_field('bathroom_values','options');
    $value = $repeater[0][slider_bathroom_l27_value];
    ?>
    <input id="pricing_param_quantity" name="pricing_param_quantity" type="hidden" value="<?php echo $value; ?>">
    </p>
    </div>
    <div class="flag__body">
    <div class="ui-slider-wrap">
    <div id="ui-slider2" data-max='<?php if(get_field('slider_bathrooms_datamax','options')) { echo get_field('slider_bathrooms_datamax','options'); } else { echo '6'; } ?>'></div>
    </div>
    </div>
    </div>
    </div>
    <div class="bedroom__description"><p><?php
    $repeater = get_field('bathroom_values','options');
    $value = $repeater[0][bathroom_values_text];
    ?>
    <input type="text" data-bathroom-message id="ui-slider__amount113" class="slider-result long_input" value="<?php echo $value; ?>"></p><span><?php _e('(Please round half baths up)', 'themestreet'); ?></span></div>
    <div class="layout layout--small layout--top">
    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r1" name="frequency_id" value="<?php the_field('slider_id_onetimeservice','options'); ?>" class="styled-radiobutton--text"/>
    <label for="r1" class='radio'><div class="verticalize"><?php _e('1 time service', 'themestreet'); ?></div></label>
    <p></p>
    </div>
    </div>

    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r2" name="frequency_id" value="<?php the_field('slider_id_everyweek','options'); ?>" class="styled-radiobutton--text"/>
    <label for="r2" class='radio'><div class="verticalize"><?php _e('Every week', 'themestreet'); ?></div></label>
    <p><?php if(get_field('discount_every_week','options')) { echo get_field('discount_every_week','options'); } else { echo '15'; } ?><?php _e('% Off', 'themestreet'); ?></p>
    </div>

    </div>

    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r3" name="frequency_id" value="<?php the_field('slider_id_everytwoweeks','options'); ?>" class="styled-radiobutton--text" checked />
    <label for="r3" class='radio'><div class="verticalize"><?php _e('Every 2 weeks', 'themestreet'); ?> <span><?php _e('(Most popular)', 'themestreet'); ?></span></div></label>
    <p><?php if(get_field('discount_every_two_weeks','options')) { echo get_field('discount_every_two_weeks','options'); } else { echo '25'; } ?><?php _e('% Off', 'themestreet'); ?></p>
    </div>

    </div>

    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r4" name="frequency_id" value="<?php the_field('slider_id_everyfourweeks','options'); ?>" class="styled-radiobutton--text" />
    <label for="r4" class='radio'><div class="verticalize"><?php _e('Every 4 weeks', 'themestreet'); ?></div></label>
    <p><?php if(get_field('discount_every_four_weeks','options')) { echo get_field('discount_every_four_weeks','options'); } else { echo '35'; } ?><?php _e('% Off', 'themestreet'); ?></p>
    </div>
    </div>
    </div>

    <div class="button-wrap text-center pt">
    <button class="btn btn--primary btn--large"><?php _e('SCHEDULE AN APPOINTMENT', 'themestreet'); ?><?php if (get_field('button_calculator','option')) : ?><span class="price-in-button">$<span id="total-price"></span>/clean</span><?php endif; ?></button>
    </div>

    </form>

    </div>
    </div>
    </div>
    </section>
    <!-- End of .subheader -->

    <?php if (get_field('one_visible')) : ?>
    <!-- Begin of .how-we-work -->
    <section id="how-we-work" class="how-we-work">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('one_visible, one_title, one_boxes, one_button_link, one_button_title');
    } ?>>
    <h2 class="text-center mb pb-"><?php the_field('one_title'); ?></h2>

    <div class="layout layout--large pb">

    <?php if (have_rows('one_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('one_boxes')) : the_row();
    // vars
    $icon = get_sub_field('one_boxes_icon');
    $image = get_sub_field('one_boxes_image');
    $title = get_sub_field('one_boxes_title');
    $description = get_sub_field('one_boxes_description');
    ?>

    <div class="layout__item large-and-up-1/3">
    <div>
    <div class="img-wrap">
    <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
    <div class="icon-wrap">
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $image['alt']; ?>">
    </div>
    </div>
    <div class="text-wrap text-center">
    <h3 class="type-x-huge"><?php echo $title; ?></h3>
    <p><?php echo $description; ?></p>
    </div>
    </div>
    </div>

    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>

    </div>

    <div class="text-center pt+">
    <a href="<?php the_field('one_button_link'); ?>" class="btn btn--primary"><?php the_field('one_button_title'); ?></a>
    </div>
    </div>
    </section>
    <!-- End of .how-we-work -->
    <?php endif; ?>

    <?php if (get_field('two_visible')) : ?>
    <!-- Begin of .trusted-list -->
    <section class="trusted-list">
    <div class="container text-center relative" <?php if (function_exists("live_edit")) {
    live_edit('two_visible, two_title, two_subtitle_one, two_subtitle_two, two_boxes');
    } ?>>
    <h2 class="mb"><?php the_field('two_title'); ?></h2>
    <p class="mb"><?php the_field('two_subtitle_one'); ?></p>
    <p class="mb+"><?php the_field('two_subtitle_two'); ?></p>
    <div class="layout layout--large layout--center">
    <?php if (have_rows('two_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('two_boxes')) : the_row();
    // vars
    $icon = get_sub_field('two_boxes_icon');
    $title = get_sub_field('two_boxes_title');
    ?>
    <div class="layout__item large-and-up-1/5 medium-1/3">
    <div class="img-wrap text-center mb">
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
    </div>
    <p class="type-large text-center color-white"><?php echo $title; ?></p>
    </div>
    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>
    </div>
    </div>
    </section>
    <!-- End of .trusted-list -->
    <?php endif; ?>

    <?php if (get_field('three_visible')) : ?>
    <!-- Begin of .big-phone -->
    <section class="big-phone">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('three_visible, three_phone_image, three_title, three_description, three_apple_link');
    } ?>>
    <div class="flag">
    <div class="flag__img">
    <?php if (get_field('three_phone_image')) : ?>
    <?php
    $picture = get_field('three_phone_image');
    ?>
    <img src="<?php echo $picture['url']; ?>" alt="<?php echo $picture['alt']; ?>">
    <?php endif; ?>
    </div>
    <div class="flag__body">
    <h2><?php the_field('three_title'); ?></h2>
    <p class="type-huge type-light mb"><?php the_field('three_description'); ?></p>
    <?php if (get_field('three_apple_link')) : ?><a href="<?php the_field('three_apple_link'); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/apple-button.png" alt=""></a><?php endif; ?>
    </div>
    </div>
    </div>
    </section>
    <!-- End of .big-phone -->
    <?php endif; ?>

    <?php if (get_field('four_visible')) : ?>
    <!-- Begin of .testimonial -->
    <section class="testimonial"<?php if (get_field('four_background_image')) { ?> style="background-image: url('<?php the_field('four_background_image'); ?>');"<?php } ?>>
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('four_visible, four_background_image, four_title');
    } ?>>
    <h2 class="text-center type-light"><?php the_field('four_title'); ?></h2>
    <div class="testimonial-slider owl-carousel mb">
    <?php
    query_posts(array('post_type' => 'testimonials', 'posts_per_page' => '100'));
    if (have_posts()) :
    ?>
    <?php while (have_posts()) : the_post(); //start of the loop ?>
    <div>
    <div class="testimonial-slider__content">
    <div>
    <p><?php the_field('user_testimonial'); ?></p>
    </div>
    </div>
    <div class="testimonial__img">
    <div class="flag">
    <div class="flag__img">
    <?php
    $image = get_field('user_image');
    $size = 'testimonial-thumb';
    $thumb = $image['sizes'][$size];
    $width = $image['sizes'][$size . '-width'];
    $height = $image['sizes'][$size . '-height'];
    if (!empty($image)):
    ?>
    <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
    <?php endif; ?>
    </div>
    <div class="flag__body">
    <h5 class="color-white type-bold"><?php the_title(); ?></h5>
    <p class="testimonial-slider__name"><?php the_field('user_description'); ?></p>
    </div>
    </div>
    </div>
    </div>
    <?php endwhile; //end of the loop ?><?php endif; ?>
    <?php wp_reset_query(); ?>

    </div>
    </div>
    </section>
    <!-- End of .testimonial -->
    <?php endif; ?>

    <?php if (get_field('five_visible')) : ?>
    <!-- Begin of .trust -->
    <section class="trust">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('five_visible, five_title, five_boxes, five_button_link, five_button_title');
    } ?>>
    <h2 class="text-center type-light mb pb-"><?php the_field('five_title'); ?></h2>

    <div class="layout mb+">
    <?php if (have_rows('five_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('five_boxes')) : the_row();
    // vars
    $icon = get_sub_field('five_boxes_icon');
    $title = get_sub_field('five_boxes_title');
    $description = get_sub_field('five_boxes_description');
    ?>
    <div class="layout__item large-and-up-1/3 text-center">
    <div>
    <div class="icon-wrap">
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
    </div>
    <h3><?php echo $title; ?></h3>
    <p><?php echo $description; ?></p>
    </div>
    </div>
    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>
    </div>
    <div class="text-center">
    <a href="<?php the_field('five_button_link'); ?>" class="btn btn--primary btn--transparent btn--small"><?php the_field('five_button_title'); ?></a>
    </div>
    </div>
    </section>
    <!-- End of .trust -->
    <?php endif; ?>

    <?php if (get_field('six_visible')) : ?>
    <!-- Begin of .book-appointment -->
    <section class="book-appointment">
    <div class="container text-center relative" <?php if (function_exists("live_edit")) {
    live_edit('six_visible, six_title, six_link, six_placeholder');
    } ?>>
    <h2 class="type-uppercase h3"><?php the_field('six_title'); ?></h2>
    <form action="<?php the_field('six_link'); ?>" method="get">
    <label><input name="zip" type="text" class="input input--primary" placeholder="<?php the_field('six_placeholder'); ?>"></label>
    <button class="btn btn--primary type-bold"><?php _e('BOOK A CLEANING NOW', 'themestreet'); ?></button>
    </form>
    </div>
    </section>
    <!-- End of .book-appointment -->
    <?php endif; ?>

    <?php if (get_field('seven_visible')) : ?>
    <!-- Begin of .partners -->
    <section class="partners">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('seven_visible, seven_boxes');
    } ?>>
    <div>
    <div class="layout layout--center layout--middle">
    <?php if (have_rows('seven_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('seven_boxes')) : the_row();
    // vars
    $icon = get_sub_field('seven_boxes_banner');
    $link = get_sub_field('seven_boxes_link');
    ?>
    <div class="layout__item large-and-up-1/6 medium-1/3 text-center">
    <?php if (get_sub_field('seven_boxes_link')) : ?><a href="<?php echo $link; ?>"><?php endif; ?>
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
    <?php if (get_sub_field('seven_boxes_link')) : ?></a><?php endif; ?>
    </div>
    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    </div>
    </div>
    </div>
    </section>
    <!-- End of .partners -->
    <?php endif; ?>

    </main>

    <?php
    endwhile;

    endif;
    ?>

    <?php get_footer(); ?>

    It’s tricky because maybe there are more places in the code that require attention, but give it a try, and let’s see if we can make some progress.

    Kind Regards.

    Thread Starter dsturner

    (@dsturner)

    I replaced the code and received this error:

    Your PHP code changes were not applied due to an error on line 556 of file wp-content/themes/bluedream/page-homepage.php.

    Please fix and try saving again. syntax error, unexpected token “endwhile”, expecting end of file

    Removing”endwhile”, another error pops up:

    Your PHP code changes were not applied due to an error on line 558 of file wp-content/themes/bluedream/page-homepage.php.

    Please fix and try saving again. syntax error, unexpected token “endif”, expecting end of file

    Removed “endif”, and received a third error:

    Your PHP code changes were not applied due to an error on line 219 of file wp-content/themes/bluedream/page-homepage.php.

    Please fix and try saving again. Uncaught Error: Undefined constant “slider_l27_value” in wp-content/themes/bluedream/page-homepage.php:219 Stack trace:

    #0 wp-includes/template-loader.php(106): include()

    #1 wp-blog-header.php(19): require_once(‘/home2/bestfiv4…’)

    #2 index.php(17): require(‘/home2/bestfiv4…’) #3 {main}

    thrown

    Hello there, this should fix the error on line 219:

      <main>

    <!-- Begin of .subheader -->
    <section class="subheader pv0"<?php if (get_field('subheader_background')) : ?> style="background-image: url('<?php the_field('subheader_background'); ?>')"<?php endif; ?>>
    <div class="container">
    <div class="text-center mb+">
    <h2 class="color-white type-normal relative" <?php if (function_exists("live_edit")) {
    live_edit('subheader_background, subheader_title, subheader_subtitle, subheader_form_action');
    } ?>><?php the_field('subheader_title'); ?></h2>
    <?php if (get_field('subheader_subtitle')) : ?><p class="color-white type-x-huge type-semibold"><?php the_field('subheader_subtitle'); ?></p><?php endif; ?>
    </div>
    <div class="layout layout--large layout--center">
    <div class="layout__item mb0">
    <script>
    var bedroom_values = <?php echo json_encode(get_field('bedroom_values', 'options')); ?>;
    var bathroom_values = <?php echo json_encode(get_field('bathroom_values', 'options')); ?>;

    jQuery(document).ready(function() {
    // slider front start
    jQuery('#ui-slider1').slider({
    orientation: "horizontal",
    animate: "fast",
    range: "min",
    min: 1,
    step: 1,
    max: <?php
    if (get_field('slider_bedrooms_datamax', 'options')) {
    echo get_field('slider_bedrooms_datamax', 'options');
    } else {
    echo '6';
    }
    ?>,
    value: 1,
    slide: function(e, t) {
    var input = jQuery('input[name="service_id"]');
    switch (t.value) {
    <?php if (have_rows('bedroom_values', 'options')) : $i = 1; ?>
    <?php while (have_rows('bedroom_values', 'options')) : the_row();
    $bedroom = get_sub_field('slider_room_number', 'options');
    $bathroom = get_sub_field('slider_l27_value', 'options');
    ?>
    case <?php echo $bedroom; ?>:
    input.val(<?php echo $bathroom; ?>);
    break;
    <?php $i++; endwhile; ?>
    <?php endif; ?>

    default:
    input.val(1);
    }

    for (var i = 0; i < bedroom_values.length; i++) {
    if (input.val() == bedroom_values[i].slider_l27_value) {
    jQuery('[data-bedroom-message]').val(bedroom_values[i].bedroom_values_text);
    }
    }

    jQuery('#ui-slider__amount1').val(t.value);
    }
    });

    jQuery('#ui-slider2').slider({
    orientation: "horizontal",
    animate: "fast",
    range: "min",
    min: 1,
    step: 1,
    max: <?php
    if (get_field('slider_bathrooms_datamax', 'options')) {
    echo get_field('slider_bathrooms_datamax', 'options');
    } else {
    echo '6';
    }
    ?>,
    value: 1,
    slide: function(e, t) {
    var input = jQuery('input[name="pricing_param_quantity"]');
    switch (t.value) {
    <?php if (have_rows('bathroom_values', 'options')) : $i = 1; ?>
    <?php while (have_rows('bathroom_values', 'options')) : the_row();
    $bedroom = get_sub_field('slider_bathroom_number', 'options');
    $bathroom = get_sub_field('slider_bathroom_l27_value', 'options');
    ?>
    case <?php echo $bedroom; ?>:
    input.val(<?php echo $bathroom; ?>);
    break;
    <?php $i++; endwhile; ?>
    <?php endif; ?>

    default:
    input.val(1);
    }

    for (var i = 0; i < bathroom_values.length; i++) {
    if (input.val() == bathroom_values[i].slider_bathroom_l27_value) {
    jQuery('[data-bathroom-message]').val(bathroom_values[i].bathroom_values_text);
    }
    }

    jQuery('#ui-slider__amount2').val(t.value);
    }
    });
    });

    var BEDROOM_RATES = {
    <?php if (have_rows('bedroom_values', 'options')) : $i = 1; ?>
    <?php while (have_rows('bedroom_values', 'options')) : the_row();
    $number = get_sub_field('slider_room_number', 'options');
    $price = get_sub_field('slider_bedroom_price', 'options');
    ?>
    <?php echo 'b' . $number; ?>: <?php echo $price; ?>,
    <?php $i++; endwhile; ?>
    <?php endif; ?>
    };

    var PER_BATHROOM = <?php
    if (get_field('bathroom_price', 'options')) {
    echo get_field('bathroom_price', 'options');
    } else {
    echo '30';
    }
    ?>;

    jQuery(window).ready(function() {
    updatePrice();
    jQuery('input[type=radio]').on('change', updatePrice);
    jQuery('#ui-slider1, #ui-slider2').on('slidechange', updatePrice);
    });

    function updatePrice() {
    var perc_off = 0.0,
    bedrooms = jQuery('#ui-slider1').slider('option', 'value'),
    bathrooms = jQuery('#ui-slider2').slider('option', 'value'),
    freq_id = jQuery('input[type=radio]:checked').attr('id'),
    total_price = 0;

    total_price = BEDROOM_RATES['b' + bedrooms];
    total_price += bathrooms * PER_BATHROOM;

    if (freq_id == 'r1') {
    // one time
    <?php
    if (get_field('discount_one_time', 'options')) {
    $percentage = get_field('discount_one_time', 'options');
    $decimal = $percentage / 100;

    echo 'perc_off = ' . $decimal;
    } else {
    echo 'perc_off = 0';
    }
    ?>
    } else if (freq_id == 'r2') {
    // every week
    <?php
    if (get_field('discount_every_week', 'options')) {
    $percentage = get_field('discount_every_week', 'options');
    $decimal = $percentage / 100;

    echo 'perc_off = ' . $decimal;
    } else {
    echo 'perc_off = 0.15';
    }
    ?>
    } else if (freq_id == 'r3') {
    // every two weeks
    <?php
    if (get_field('discount_every_two_weeks', 'options')) {
    $percentage = get_field('discount_every_two_weeks', 'options');
    $decimal = $percentage / 100;

    echo 'perc_off = ' . $decimal;
    } else {
    echo 'perc_off = 0.25';
    }
    ?>
    } else if (freq_id == 'r4') {
    // every four weeks
    <?php
    if (get_field('discount_every_four_weeks', 'options')) {
    $percentage = get_field('discount_every_four_weeks', 'options');
    $decimal = $percentage / 100;

    echo 'perc_off = ' . $decimal;
    } else {
    echo 'perc_off = 0.35';
    }
    ?>
    }

    <?php
    if (get_field('tax_percentage', 'options')) :
    $tax = get_field('tax_percentage', 'options');
    $tax = $tax / 100;
    $tax = $tax + 1;
    ?>

    // if tax, show price with tax
    total_price = total_price *<?php echo $tax; ?>;
    <?php endif; ?>

    // subtract frequency discount
    total_price *= (1 - perc_off);
    // set total price on button
    jQuery("#total-price").html(parseFloat(total_price).toFixed(2));
    }

    jQuery(document).on('change', '#ui-slider__amount1', function(e) {
    // console.log(jQuery(this).val());
    });
    </script>
    <form action="<?php the_field('subheader_form_action'); ?>" method="get">
    <div class="flag-wrap">
    <div class="flag flag--small mb pb--">
    <div class="flag__img">
    <p class="slider-result-wrap"><?php _e('Bedrooms', 'themestreet'); ?>:
    <input type="text" id="ui-slider__amount1" class="slider-result" value="1">
    <?php
    $repeater = get_field('bedroom_values','options');
    $value = $repeater[0]['slider_l27_value'];
    ?>
    <input id="service_id" name="service_id" type="hidden" value="<?php echo $value; ?>">
    </p>
    </div>
    <div class="flag__body">
    <div class="ui-slider-wrap">
    <div id="ui-slider1" data-max='<?php if(get_field('slider_bedrooms_datamax','options')) { echo get_field('slider_bedrooms_datamax','options'); } else { echo '6'; } ?>'></div>
    </div>
    </div>
    </div>
    </div>
    <div class="bedroom__description"><p>
    <?php
    $repeater = get_field('bedroom_values','options');
    $value = $repeater[0][bedroom_values_text];
    ?>
    <input type="text" data-bedroom-message id="ui-slider__amount112" class="slider-result long_input" value="<?php echo $value; ?>">
    </p><span><?php _e('(Kitchen and living room included)', 'themestreet'); ?></span></div>
    <div class="flag-wrap">
    <div class="flag flag--small mb">
    <div class="flag__img">
    <p class="slider-result-wrap"><?php _e('Bathrooms', 'themestreet'); ?>:
    <input type="text" id="ui-slider__amount2" class="slider-result" value="1">
    <?php
    $repeater = get_field('bathroom_values','options');
    $value = $repeater[0][slider_bathroom_l27_value];
    ?>
    <input id="pricing_param_quantity" name="pricing_param_quantity" type="hidden" value="<?php echo $value; ?>">
    </p>
    </div>
    <div class="flag__body">
    <div class="ui-slider-wrap">
    <div id="ui-slider2" data-max='<?php if(get_field('slider_bathrooms_datamax','options')) { echo get_field('slider_bathrooms_datamax','options'); } else { echo '6'; } ?>'></div>
    </div>
    </div>
    </div>
    </div>
    <div class="bedroom__description"><p><?php
    $repeater = get_field('bathroom_values','options');
    $value = $repeater[0][bathroom_values_text];
    ?>
    <input type="text" data-bathroom-message id="ui-slider__amount113" class="slider-result long_input" value="<?php echo $value; ?>"></p><span><?php _e('(Please round half baths up)', 'themestreet'); ?></span></div>
    <div class="layout layout--small layout--top">
    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r1" name="frequency_id" value="<?php the_field('slider_id_onetimeservice','options'); ?>" class="styled-radiobutton--text"/>
    <label for="r1" class='radio'><div class="verticalize"><?php _e('1 time service', 'themestreet'); ?></div></label>
    <p></p>
    </div>
    </div>

    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r2" name="frequency_id" value="<?php the_field('slider_id_everyweek','options'); ?>" class="styled-radiobutton--text"/>
    <label for="r2" class='radio'><div class="verticalize"><?php _e('Every week', 'themestreet'); ?></div></label>
    <p><?php if(get_field('discount_every_week','options')) { echo get_field('discount_every_week','options'); } else { echo '15'; } ?><?php _e('% Off', 'themestreet'); ?></p>
    </div>

    </div>

    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r3" name="frequency_id" value="<?php the_field('slider_id_everytwoweeks','options'); ?>" class="styled-radiobutton--text" checked />
    <label for="r3" class='radio'><div class="verticalize"><?php _e('Every 2 weeks', 'themestreet'); ?> <span><?php _e('(Most popular)', 'themestreet'); ?></span></div></label>
    <p><?php if(get_field('discount_every_two_weeks','options')) { echo get_field('discount_every_two_weeks','options'); } else { echo '25'; } ?><?php _e('% Off', 'themestreet'); ?></p>
    </div>

    </div>

    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r4" name="frequency_id" value="<?php the_field('slider_id_everyfourweeks','options'); ?>" class="styled-radiobutton--text" />
    <label for="r4" class='radio'><div class="verticalize"><?php _e('Every 4 weeks', 'themestreet'); ?></div></label>
    <p><?php if(get_field('discount_every_four_weeks','options')) { echo get_field('discount_every_four_weeks','options'); } else { echo '35'; } ?><?php _e('% Off', 'themestreet'); ?></p>
    </div>
    </div>
    </div>

    <div class="button-wrap text-center pt">
    <button class="btn btn--primary btn--large"><?php _e('SCHEDULE AN APPOINTMENT', 'themestreet'); ?><?php if (get_field('button_calculator','option')) : ?><span class="price-in-button">$<span id="total-price"></span>/clean</span><?php endif; ?></button>
    </div>

    </form>

    </div>
    </div>
    </div>
    </section>
    <!-- End of .subheader -->

    <?php if (get_field('one_visible')) : ?>
    <!-- Begin of .how-we-work -->
    <section id="how-we-work" class="how-we-work">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('one_visible, one_title, one_boxes, one_button_link, one_button_title');
    } ?>>
    <h2 class="text-center mb pb-"><?php the_field('one_title'); ?></h2>

    <div class="layout layout--large pb">

    <?php if (have_rows('one_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('one_boxes')) : the_row();
    // vars
    $icon = get_sub_field('one_boxes_icon');
    $image = get_sub_field('one_boxes_image');
    $title = get_sub_field('one_boxes_title');
    $description = get_sub_field('one_boxes_description');
    ?>

    <div class="layout__item large-and-up-1/3">
    <div>
    <div class="img-wrap">
    <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
    <div class="icon-wrap">
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $image['alt']; ?>">
    </div>
    </div>
    <div class="text-wrap text-center">
    <h3 class="type-x-huge"><?php echo $title; ?></h3>
    <p><?php echo $description; ?></p>
    </div>
    </div>
    </div>

    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>

    </div>

    <div class="text-center pt+">
    <a href="<?php the_field('one_button_link'); ?>" class="btn btn--primary"><?php the_field('one_button_title'); ?></a>
    </div>
    </div>
    </section>
    <!-- End of .how-we-work -->
    <?php endif; ?>

    <?php if (get_field('two_visible')) : ?>
    <!-- Begin of .trusted-list -->
    <section class="trusted-list">
    <div class="container text-center relative" <?php if (function_exists("live_edit")) {
    live_edit('two_visible, two_title, two_subtitle_one, two_subtitle_two, two_boxes');
    } ?>>
    <h2 class="mb"><?php the_field('two_title'); ?></h2>
    <p class="mb"><?php the_field('two_subtitle_one'); ?></p>
    <p class="mb+"><?php the_field('two_subtitle_two'); ?></p>
    <div class="layout layout--large layout--center">
    <?php if (have_rows('two_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('two_boxes')) : the_row();
    // vars
    $icon = get_sub_field('two_boxes_icon');
    $title = get_sub_field('two_boxes_title');
    ?>
    <div class="layout__item large-and-up-1/5 medium-1/3">
    <div class="img-wrap text-center mb">
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
    </div>
    <p class="type-large text-center color-white"><?php echo $title; ?></p>
    </div>
    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>
    </div>
    </div>
    </section>
    <!-- End of .trusted-list -->
    <?php endif; ?>

    <?php if (get_field('three_visible')) : ?>
    <!-- Begin of .big-phone -->
    <section class="big-phone">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('three_visible, three_phone_image, three_title, three_description, three_apple_link');
    } ?>>
    <div class="flag">
    <div class="flag__img">
    <?php if (get_field('three_phone_image')) : ?>
    <?php
    $picture = get_field('three_phone_image');
    ?>
    <img src="<?php echo $picture['url']; ?>" alt="<?php echo $picture['alt']; ?>">
    <?php endif; ?>
    </div>
    <div class="flag__body">
    <h2><?php the_field('three_title'); ?></h2>
    <p class="type-huge type-light mb"><?php the_field('three_description'); ?></p>
    <?php if (get_field('three_apple_link')) : ?><a href="<?php the_field('three_apple_link'); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/apple-button.png" alt=""></a><?php endif; ?>
    </div>
    </div>
    </div>
    </section>
    <!-- End of .big-phone -->
    <?php endif; ?>

    <?php if (get_field('four_visible')) : ?>
    <!-- Begin of .testimonial -->
    <section class="testimonial"<?php if (get_field('four_background_image')) { ?> style="background-image: url('<?php the_field('four_background_image'); ?>');"<?php } ?>>
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('four_visible, four_background_image, four_title');
    } ?>>
    <h2 class="text-center type-light"><?php the_field('four_title'); ?></h2>
    <div class="testimonial-slider owl-carousel mb">
    <?php
    query_posts(array('post_type' => 'testimonials', 'posts_per_page' => '100'));
    if (have_posts()) :
    ?>
    <?php while (have_posts()) : the_post(); //start of the loop ?>
    <div>
    <div class="testimonial-slider__content">
    <div>
    <p><?php the_field('user_testimonial'); ?></p>
    </div>
    </div>
    <div class="testimonial__img">
    <div class="flag">
    <div class="flag__img">
    <?php
    $image = get_field('user_image');
    $size = 'testimonial-thumb';
    $thumb = $image['sizes'][$size];
    $width = $image['sizes'][$size . '-width'];
    $height = $image['sizes'][$size . '-height'];
    if (!empty($image)):
    ?>
    <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
    <?php endif; ?>
    </div>
    <div class="flag__body">
    <h5 class="color-white type-bold"><?php the_title(); ?></h5>
    <p class="testimonial-slider__name"><?php the_field('user_description'); ?></p>
    </div>
    </div>
    </div>
    </div>
    <?php endwhile; //end of the loop ?><?php endif; ?>
    <?php wp_reset_query(); ?>

    </div>
    </div>
    </section>
    <!-- End of .testimonial -->
    <?php endif; ?>

    <?php if (get_field('five_visible')) : ?>
    <!-- Begin of .trust -->
    <section class="trust">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('five_visible, five_title, five_boxes, five_button_link, five_button_title');
    } ?>>
    <h2 class="text-center type-light mb pb-"><?php the_field('five_title'); ?></h2>

    <div class="layout mb+">
    <?php if (have_rows('five_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('five_boxes')) : the_row();
    // vars
    $icon = get_sub_field('five_boxes_icon');
    $title = get_sub_field('five_boxes_title');
    $description = get_sub_field('five_boxes_description');
    ?>
    <div class="layout__item large-and-up-1/3 text-center">
    <div>
    <div class="icon-wrap">
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
    </div>
    <h3><?php echo $title; ?></h3>
    <p><?php echo $description; ?></p>
    </div>
    </div>
    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>
    </div>
    <div class="text-center">
    <a href="<?php the_field('five_button_link'); ?>" class="btn btn--primary btn--transparent btn--small"><?php the_field('five_button_title'); ?></a>
    </div>
    </div>
    </section>
    <!-- End of .trust -->
    <?php endif; ?>

    <?php if (get_field('six_visible')) : ?>
    <!-- Begin of .book-appointment -->
    <section class="book-appointment">
    <div class="container text-center relative" <?php if (function_exists("live_edit")) {
    live_edit('six_visible, six_title, six_link, six_placeholder');
    } ?>>
    <h2 class="type-uppercase h3"><?php the_field('six_title'); ?></h2>
    <form action="<?php the_field('six_link'); ?>" method="get">
    <label><input name="zip" type="text" class="input input--primary" placeholder="<?php the_field('six_placeholder'); ?>"></label>
    <button class="btn btn--primary type-bold"><?php _e('BOOK A CLEANING NOW', 'themestreet'); ?></button>
    </form>
    </div>
    </section>
    <!-- End of .book-appointment -->
    <?php endif; ?>

    <?php if (get_field('seven_visible')) : ?>
    <!-- Begin of .partners -->
    <section class="partners">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('seven_visible, seven_boxes');
    } ?>>
    <div>
    <div class="layout layout--center layout--middle">
    <?php if (have_rows('seven_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('seven_boxes')) : the_row();
    // vars
    $icon = get_sub_field('seven_boxes_banner');
    $link = get_sub_field('seven_boxes_link');
    ?>
    <div class="layout__item large-and-up-1/6 medium-1/3 text-center">
    <?php if (get_sub_field('seven_boxes_link')) : ?><a href="<?php echo $link; ?>"><?php endif; ?>
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
    <?php if (get_sub_field('seven_boxes_link')) : ?></a><?php endif; ?>
    </div>
    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    </div>
    </div>
    </div>
    </section>
    <!-- End of .partners -->
    <?php endif; ?>

    </main>

    <?php get_footer(); ?>

    There will probably be more errors, but let’s see will this solve the error from line 219, give it a go.

    Kind Regards.

    Another code to try:

      <main>

    <!-- Begin of .subheader -->
    <section class="subheader pv0"<?php if (get_field('subheader_background')) : ?> style="background-image: url('<?php the_field('subheader_background'); ?>')"<?php endif; ?>>
    <div class="container">
    <div class="text-center mb+">
    <h2 class="color-white type-normal relative" <?php if (function_exists("live_edit")) {
    live_edit('subheader_background, subheader_title, subheader_subtitle, subheader_form_action');
    } ?>><?php the_field('subheader_title'); ?></h2>
    <?php if (get_field('subheader_subtitle')) : ?><p class="color-white type-x-huge type-semibold"><?php the_field('subheader_subtitle'); ?></p><?php endif; ?>
    </div>
    <div class="layout layout--large layout--center">
    <div class="layout__item mb0">
    <script>
    var bedroom_values = <?php echo json_encode(get_field('bedroom_values', 'options')); ?>;
    var bathroom_values = <?php echo json_encode(get_field('bathroom_values', 'options')); ?>;

    jQuery(document).ready(function() {
    // Slider for bedrooms
    jQuery('#ui-slider1').slider({
    orientation: "horizontal",
    animate: "fast",
    range: "min",
    min: 1,
    step: 1,
    max: <?php echo get_field('slider_bedrooms_datamax', 'options') ?: 6; ?>,
    value: 1,
    slide: function(e, t) {
    var input = jQuery('input[name="service_id"]');
    switch (t.value) {
    <?php if (have_rows('bedroom_values', 'options')) : ?>
    <?php while (have_rows('bedroom_values', 'options')) : the_row();
    $bedroom = get_sub_field('slider_room_number');
    $bathroom = get_sub_field('slider_l27_value');
    ?>
    case <?php echo $bedroom; ?>:
    input.val(<?php echo $bathroom; ?>);
    break;
    <?php endwhile; ?>
    <?php endif; ?>

    default:
    input.val(1);
    }

    for (var i = 0; i < bedroom_values.length; i++) {
    if (input.val() == bedroom_values[i]['slider_l27_value']) {
    jQuery('[data-bedroom-message]').val(bedroom_values[i]['bedroom_values_text']);
    }
    }

    jQuery('#ui-slider__amount1').val(t.value);
    }
    });

    // Slider for bathrooms
    jQuery('#ui-slider2').slider({
    orientation: "horizontal",
    animate: "fast",
    range: "min",
    min: 1,
    step: 1,
    max: <?php echo get_field('slider_bathrooms_datamax', 'options') ?: 6; ?>,
    value: 1,
    slide: function(e, t) {
    var input = jQuery('input[name="pricing_param_quantity"]');
    switch (t.value) {
    <?php if (have_rows('bathroom_values', 'options')) : ?>
    <?php while (have_rows('bathroom_values', 'options')) : the_row();
    $bedroom = get_sub_field('slider_bathroom_number');
    $bathroom = get_sub_field('slider_bathroom_l27_value');
    ?>
    case <?php echo $bedroom; ?>:
    input.val(<?php echo $bathroom; ?>);
    break;
    <?php endwhile; ?>
    <?php endif; ?>

    default:
    input.val(1);
    }

    for (var i = 0; i < bathroom_values.length; i++) {
    if (input.val() == bathroom_values[i]['slider_bathroom_l27_value']) {
    jQuery('[data-bathroom-message]').val(bathroom_values[i]['bathroom_values_text']);
    }
    }

    jQuery('#ui-slider__amount2').val(t.value);
    }
    });
    });

    var BEDROOM_RATES = {
    <?php if (have_rows('bedroom_values', 'options')) : ?>
    <?php while (have_rows('bedroom_values', 'options')) : the_row();
    $number = get_sub_field('slider_room_number');
    $price = get_sub_field('slider_bedroom_price');
    ?>
    'b<?php echo $number; ?>': <?php echo $price; ?>,
    <?php endwhile; ?>
    <?php endif; ?>
    };

    var PER_BATHROOM = <?php echo get_field('bathroom_price', 'options') ?: 30; ?>;

    jQuery(window).ready(function() {
    updatePrice();
    jQuery('input[type=radio]').on('change', updatePrice);
    jQuery('#ui-slider1, #ui-slider2').on('slidechange', updatePrice);
    });

    function updatePrice() {
    var perc_off = 0.0,
    bedrooms = jQuery('#ui-slider1').slider('option', 'value'),
    bathrooms = jQuery('#ui-slider2').slider('option', 'value'),
    freq_id = jQuery('input[type=radio]:checked').attr('id'),
    total_price = 0;

    total_price = BEDROOM_RATES['b' + bedrooms];
    total_price += bathrooms * PER_BATHROOM;

    if (freq_id == 'r1') {
    perc_off = <?php echo get_field('discount_one_time', 'options') ? get_field('discount_one_time', 'options') / 100 : 0; ?>;
    } else if (freq_id == 'r2') {
    perc_off = <?php echo get_field('discount_every_week', 'options') ? get_field('discount_every_week', 'options') / 100 : 0.15; ?>;
    } else if (freq_id == 'r3') {
    perc_off = <?php echo get_field('discount_every_two_weeks', 'options') ? get_field('discount_every_two_weeks', 'options') / 100 : 0.25; ?>;
    } else if (freq_id == 'r4') {
    perc_off = <?php echo get_field('discount_every_four_weeks', 'options') ? get_field('discount_every_four_weeks', 'options') / 100 : 0.35; ?>;
    }

    <?php if (get_field('tax_percentage', 'options')) :
    $tax = get_field('tax_percentage', 'options') / 100 + 1;
    ?>
    total_price *= <?php echo $tax; ?>;
    <?php endif; ?>

    total_price *= (1 - perc_off);
    jQuery("#total-price").html(parseFloat(total_price).toFixed(2));
    }

    jQuery(document).on('change', '#ui-slider__amount1', function(e) {
    // Additional functionality if needed
    });
    </script>

    <form action="<?php the_field('subheader_form_action'); ?>" method="get">
    <div class="flag-wrap">
    <div class="flag flag--small mb pb--">
    <div class="flag__img">
    <p class="slider-result-wrap"><?php _e('Bedrooms', 'themestreet'); ?>:
    <input type="text" id="ui-slider__amount1" class="slider-result" value="1">
    <?php
    $repeater = get_field('bedroom_values','options');
    $value = $repeater[0]['slider_l27_value'];
    ?>
    <input id="service_id" name="service_id" type="hidden" value="<?php echo $value; ?>">
    </p>
    </div>
    <div class="flag__body">
    <div class="ui-slider-wrap">
    <div id="ui-slider1" data-max='<?php if(get_field('slider_bedrooms_datamax','options')) { echo get_field('slider_bedrooms_datamax','options'); } else { echo '6'; } ?>'></div>
    </div>
    </div>
    </div>
    </div>
    <div class="bedroom__description"><p>
    <?php
    $repeater = get_field('bedroom_values','options');
    $value = $repeater[0][bedroom_values_text];
    ?>
    <input type="text" data-bedroom-message id="ui-slider__amount112" class="slider-result long_input" value="<?php echo $value; ?>">
    </p><span><?php _e('(Kitchen and living room included)', 'themestreet'); ?></span></div>
    <div class="flag-wrap">
    <div class="flag flag--small mb">
    <div class="flag__img">
    <p class="slider-result-wrap"><?php _e('Bathrooms', 'themestreet'); ?>:
    <input type="text" id="ui-slider__amount2" class="slider-result" value="1">
    <?php
    $repeater = get_field('bathroom_values','options');
    $value = $repeater[0][slider_bathroom_l27_value];
    ?>
    <input id="pricing_param_quantity" name="pricing_param_quantity" type="hidden" value="<?php echo $value; ?>">
    </p>
    </div>
    <div class="flag__body">
    <div class="ui-slider-wrap">
    <div id="ui-slider2" data-max='<?php if(get_field('slider_bathrooms_datamax','options')) { echo get_field('slider_bathrooms_datamax','options'); } else { echo '6'; } ?>'></div>
    </div>
    </div>
    </div>
    </div>
    <div class="bedroom__description"><p><?php
    $repeater = get_field('bathroom_values','options');
    $value = $repeater[0][bathroom_values_text];
    ?>
    <input type="text" data-bathroom-message id="ui-slider__amount113" class="slider-result long_input" value="<?php echo $value; ?>"></p><span><?php _e('(Please round half baths up)', 'themestreet'); ?></span></div>
    <div class="layout layout--small layout--top">
    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r1" name="frequency_id" value="<?php the_field('slider_id_onetimeservice','options'); ?>" class="styled-radiobutton--text"/>
    <label for="r1" class='radio'><div class="verticalize"><?php _e('1 time service', 'themestreet'); ?></div></label>
    <p></p>
    </div>
    </div>

    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r2" name="frequency_id" value="<?php the_field('slider_id_everyweek','options'); ?>" class="styled-radiobutton--text"/>
    <label for="r2" class='radio'><div class="verticalize"><?php _e('Every week', 'themestreet'); ?></div></label>
    <p><?php if(get_field('discount_every_week','options')) { echo get_field('discount_every_week','options'); } else { echo '15'; } ?><?php _e('% Off', 'themestreet'); ?></p>
    </div>

    </div>

    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r3" name="frequency_id" value="<?php the_field('slider_id_everytwoweeks','options'); ?>" class="styled-radiobutton--text" checked />
    <label for="r3" class='radio'><div class="verticalize"><?php _e('Every 2 weeks', 'themestreet'); ?> <span><?php _e('(Most popular)', 'themestreet'); ?></span></div></label>
    <p><?php if(get_field('discount_every_two_weeks','options')) { echo get_field('discount_every_two_weeks','options'); } else { echo '25'; } ?><?php _e('% Off', 'themestreet'); ?></p>
    </div>

    </div>

    <div class="layout__item large-and-up-1/4 1/2">
    <div class="radio_wrap">
    <input type="radio" id="r4" name="frequency_id" value="<?php the_field('slider_id_everyfourweeks','options'); ?>" class="styled-radiobutton--text" />
    <label for="r4" class='radio'><div class="verticalize"><?php _e('Every 4 weeks', 'themestreet'); ?></div></label>
    <p><?php if(get_field('discount_every_four_weeks','options')) { echo get_field('discount_every_four_weeks','options'); } else { echo '35'; } ?><?php _e('% Off', 'themestreet'); ?></p>
    </div>
    </div>
    </div>

    <div class="button-wrap text-center pt">
    <button class="btn btn--primary btn--large"><?php _e('SCHEDULE AN APPOINTMENT', 'themestreet'); ?><?php if (get_field('button_calculator','option')) : ?><span class="price-in-button">$<span id="total-price"></span>/clean</span><?php endif; ?></button>
    </div>

    </form>

    </div>
    </div>
    </div>
    </section>
    <!-- End of .subheader -->

    <?php if (get_field('one_visible')) : ?>
    <!-- Begin of .how-we-work -->
    <section id="how-we-work" class="how-we-work">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('one_visible, one_title, one_boxes, one_button_link, one_button_title');
    } ?>>
    <h2 class="text-center mb pb-"><?php the_field('one_title'); ?></h2>

    <div class="layout layout--large pb">

    <?php if (have_rows('one_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('one_boxes')) : the_row();
    // vars
    $icon = get_sub_field('one_boxes_icon');
    $image = get_sub_field('one_boxes_image');
    $title = get_sub_field('one_boxes_title');
    $description = get_sub_field('one_boxes_description');
    ?>

    <div class="layout__item large-and-up-1/3">
    <div>
    <div class="img-wrap">
    <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
    <div class="icon-wrap">
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $image['alt']; ?>">
    </div>
    </div>
    <div class="text-wrap text-center">
    <h3 class="type-x-huge"><?php echo $title; ?></h3>
    <p><?php echo $description; ?></p>
    </div>
    </div>
    </div>

    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>

    </div>

    <div class="text-center pt+">
    <a href="<?php the_field('one_button_link'); ?>" class="btn btn--primary"><?php the_field('one_button_title'); ?></a>
    </div>
    </div>
    </section>
    <!-- End of .how-we-work -->
    <?php endif; ?>

    <?php if (get_field('two_visible')) : ?>
    <!-- Begin of .trusted-list -->
    <section class="trusted-list">
    <div class="container text-center relative" <?php if (function_exists("live_edit")) {
    live_edit('two_visible, two_title, two_subtitle_one, two_subtitle_two, two_boxes');
    } ?>>
    <h2 class="mb"><?php the_field('two_title'); ?></h2>
    <p class="mb"><?php the_field('two_subtitle_one'); ?></p>
    <p class="mb+"><?php the_field('two_subtitle_two'); ?></p>
    <div class="layout layout--large layout--center">
    <?php if (have_rows('two_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('two_boxes')) : the_row();
    // vars
    $icon = get_sub_field('two_boxes_icon');
    $title = get_sub_field('two_boxes_title');
    ?>
    <div class="layout__item large-and-up-1/5 medium-1/3">
    <div class="img-wrap text-center mb">
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
    </div>
    <p class="type-large text-center color-white"><?php echo $title; ?></p>
    </div>
    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>
    </div>
    </div>
    </section>
    <!-- End of .trusted-list -->
    <?php endif; ?>

    <?php if (get_field('three_visible')) : ?>
    <!-- Begin of .big-phone -->
    <section class="big-phone">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('three_visible, three_phone_image, three_title, three_description, three_apple_link');
    } ?>>
    <div class="flag">
    <div class="flag__img">
    <?php if (get_field('three_phone_image')) : ?>
    <?php
    $picture = get_field('three_phone_image');
    ?>
    <img src="<?php echo $picture['url']; ?>" alt="<?php echo $picture['alt']; ?>">
    <?php endif; ?>
    </div>
    <div class="flag__body">
    <h2><?php the_field('three_title'); ?></h2>
    <p class="type-huge type-light mb"><?php the_field('three_description'); ?></p>
    <?php if (get_field('three_apple_link')) : ?><a href="<?php the_field('three_apple_link'); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/apple-button.png" alt=""></a><?php endif; ?>
    </div>
    </div>
    </div>
    </section>
    <!-- End of .big-phone -->
    <?php endif; ?>

    <?php if (get_field('four_visible')) : ?>
    <!-- Begin of .testimonial -->
    <section class="testimonial"<?php if (get_field('four_background_image')) { ?> style="background-image: url('<?php the_field('four_background_image'); ?>');"<?php } ?>>
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('four_visible, four_background_image, four_title');
    } ?>>
    <h2 class="text-center type-light"><?php the_field('four_title'); ?></h2>
    <div class="testimonial-slider owl-carousel mb">
    <?php
    query_posts(array('post_type' => 'testimonials', 'posts_per_page' => '100'));
    if (have_posts()) :
    ?>
    <?php while (have_posts()) : the_post(); //start of the loop ?>
    <div>
    <div class="testimonial-slider__content">
    <div>
    <p><?php the_field('user_testimonial'); ?></p>
    </div>
    </div>
    <div class="testimonial__img">
    <div class="flag">
    <div class="flag__img">
    <?php
    $image = get_field('user_image');
    $size = 'testimonial-thumb';
    $thumb = $image['sizes'][$size];
    $width = $image['sizes'][$size . '-width'];
    $height = $image['sizes'][$size . '-height'];
    if (!empty($image)):
    ?>
    <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
    <?php endif; ?>
    </div>
    <div class="flag__body">
    <h5 class="color-white type-bold"><?php the_title(); ?></h5>
    <p class="testimonial-slider__name"><?php the_field('user_description'); ?></p>
    </div>
    </div>
    </div>
    </div>
    <?php endwhile; //end of the loop ?><?php endif; ?>
    <?php wp_reset_query(); ?>

    </div>
    </div>
    </section>
    <!-- End of .testimonial -->
    <?php endif; ?>

    <?php if (get_field('five_visible')) : ?>
    <!-- Begin of .trust -->
    <section class="trust">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('five_visible, five_title, five_boxes, five_button_link, five_button_title');
    } ?>>
    <h2 class="text-center type-light mb pb-"><?php the_field('five_title'); ?></h2>

    <div class="layout mb+">
    <?php if (have_rows('five_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('five_boxes')) : the_row();
    // vars
    $icon = get_sub_field('five_boxes_icon');
    $title = get_sub_field('five_boxes_title');
    $description = get_sub_field('five_boxes_description');
    ?>
    <div class="layout__item large-and-up-1/3 text-center">
    <div>
    <div class="icon-wrap">
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
    </div>
    <h3><?php echo $title; ?></h3>
    <p><?php echo $description; ?></p>
    </div>
    </div>
    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>
    </div>
    <div class="text-center">
    <a href="<?php the_field('five_button_link'); ?>" class="btn btn--primary btn--transparent btn--small"><?php the_field('five_button_title'); ?></a>
    </div>
    </div>
    </section>
    <!-- End of .trust -->
    <?php endif; ?>

    <?php if (get_field('six_visible')) : ?>
    <!-- Begin of .book-appointment -->
    <section class="book-appointment">
    <div class="container text-center relative" <?php if (function_exists("live_edit")) {
    live_edit('six_visible, six_title, six_link, six_placeholder');
    } ?>>
    <h2 class="type-uppercase h3"><?php the_field('six_title'); ?></h2>
    <form action="<?php the_field('six_link'); ?>" method="get">
    <label><input name="zip" type="text" class="input input--primary" placeholder="<?php the_field('six_placeholder'); ?>"></label>
    <button class="btn btn--primary type-bold"><?php _e('BOOK A CLEANING NOW', 'themestreet'); ?></button>
    </form>
    </div>
    </section>
    <!-- End of .book-appointment -->
    <?php endif; ?>

    <?php if (get_field('seven_visible')) : ?>
    <!-- Begin of .partners -->
    <section class="partners">
    <div class="container relative" <?php if (function_exists("live_edit")) {
    live_edit('seven_visible, seven_boxes');
    } ?>>
    <div>
    <div class="layout layout--center layout--middle">
    <?php if (have_rows('seven_boxes')) : $i = 1; ?>
    <?php
    while (have_rows('seven_boxes')) : the_row();
    // vars
    $icon = get_sub_field('seven_boxes_banner');
    $link = get_sub_field('seven_boxes_link');
    ?>
    <div class="layout__item large-and-up-1/6 medium-1/3 text-center">
    <?php if (get_sub_field('seven_boxes_link')) : ?><a href="<?php echo $link; ?>"><?php endif; ?>
    <img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt']; ?>">
    <?php if (get_sub_field('seven_boxes_link')) : ?></a><?php endif; ?>
    </div>
    <?php $i++; ?>
    <?php endwhile; ?>
    <?php endif; ?>
    </div>
    </div>
    </div>
    </section>
    <!-- End of .partners -->
    <?php endif; ?>

    </main>

    <?php get_footer(); ?>

    Let’s see will this do anything?

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.