Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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

    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(); ?>

    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(); ?>
    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.
Viewing 4 replies - 1 through 4 (of 4 total)