WPMajestic
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Datenbank l?schenHello there,
Check this article -> https://www.strato.nl/faq/hosting/het-inrichten-van-databases/#phpmyadmin – get access to phpMyAdmin from your hosting, and then you can delete the database from there -> https://www.scalahosting.com/kb/how-to-delete-a-mysql-database/ (check the part saying “Deleting a Database in phpMyAdmin”.
Kind Regards.
Forum: Everything else WordPress
In reply to: Website Speed IssuesHello there,
Speed depends on many factors, number of plugin, number of scripts, number of database queries and their complexity, quality of hosting, etc. Backend slowness is mostly because there are slow database queries and/or big number of them. You can use https://www.ads-software.com/plugins/query-monitor/ plugin to check what’s going on in the backend.
But your front-end is also slow, your page size is almost 30 MB – https://tools.pingdom.com/#64758334bac00000 – you have work to do regarding image optimization and serving them as webp, then – check the Revolution slider settings for defer/async of their scripts – I see they also impact the page speed , it also looks like that gzip compression on your hosting (Host Papa) is not enabled, etc.
I hope you find this helpful, kind regards.
Forum: Fixing WordPress
In reply to: Homepage is missing slider and sections…Please Help.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?
Forum: Fixing WordPress
In reply to: Homepage is missing slider and sections…Please Help.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.
Forum: Developing with WordPress
In reply to: Some labels of selectors in the search box have changedGood catch, if you compare the dropdown which works -> https://prnt.sc/Cq30UdfzZYUI – with dropdown which does not work as wanted -> https://prnt.sc/KudnmIkVnAqX – it’s clear that there is empty option value and that is why specific dropdowns do not work as intended.
Forum: Fixing WordPress
In reply to: Homepage is missing slider and sections…Please Help.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.
Forum: Fixing WordPress
In reply to: Homepage is missing slider and sections…Please Help.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.
Forum: Fixing WordPress
In reply to: No idea how to add new link to existing menu in new Editor pageHello there,
I see that your menu is added as the Elementor widget area. But you should be able to access the menus via this link -> https://your-hairdresser.com/wp-admin/nav-menus.php
Kind Regards.
Forum: Fixing WordPress
In reply to: Homepage is missing slider and sections…Please Help.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.
Forum: Developing with WordPress
In reply to: create css for paddingGlad to be of assistance, cheers ??
Forum: Developing with WordPress
In reply to: create css for paddingHi there,
You could avoid this complication with CSS, I see that you have 4 columns – https://prnt.sc/fdMXZHMK7fjL – that is why products are not centered, 3 products and 4 columns, for this to be good you need to have 3 columns, like you had on your site before -> https://prnt.sc/NaOn-2qR925N – check the options to insert those categories as 3 columns content.
Kind Regards.
Forum: Everything else WordPress
In reply to: Problem in user registration emailHello there,
You could enable debug mode in order to see what triggers the fatal error, here is article on how to enable debug mode, you can use a plugin if you are not confident in touching the wp-config.php file yourself – https://www.wpbeginner.com/wp-tutorials/how-to-easily-enable-wordpress-debug-mode-to-fix-site-errors/
Please share the fatal error message and let’s see if it can pin-point at the exact problem.
Kind Regards.
Forum: Everything else WordPress
In reply to: Inquiry about WooCommerce Order Data StorageHello there,
To reply to your questions, yes – WooCommerce records all order data, here are the primary database tables involved in storing order information:
wp_posts
Table: Each order is stored as a post of typeshop_order
. This table holds the basic order information, including the order ID, status, date, and other metadata.wp_postmeta
Table: This table stores the order meta-data. It includes details like billing and shipping information, payment method, order total, and any custom data related to the order.wp_woocommerce_order_items
Table: This table stores individual items associated with each order, such as the products purchased in the order.wp_woocommerce_order_itemmeta
Table: This table stores meta-data for each order item, including product IDs, quantities, tax data, and other item-specific details.wp_woocommerce_payment_tokens
andwp_woocommerce_payment_tokenmeta
Tables: These tables store payment token information if the site uses saved payment methods.
The WooCommerce data is stored in the same database as the rest of the WordPress site. Database defined in the wp-config.php file.
We hope you find this answer helpful, cheers.
Forum: Developing with WordPress
In reply to: Store custom data inside block “metadata” attributeHello there,
It is generally safe to store custom data in the “metadata” attribute of a block definition with proper namespacing and care. However, be mindful of potential conflicts or changes in the WordPress ecosystem. Using custom block attributes or similar alternatives may provide a more reliable and maintainable approach in the long run.
Instead of metadata, you could define custom attributes for the block. These are intended for block-specific data and are less likely to be altered or overwritten inadvertently. Example of adding custom attributes:
const myBlock = {
name: 'my-plugin/my-block',
attributes: {
myCustomAttribute: {
type: 'string',
default: 'defaultValue'
}
},
// other block settings
};We hope you find this helpful, cheers.
Forum: Fixing WordPress
In reply to: Homepage is missing slider and sections…Please Help.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.