var Cli_Data = {"nn_cookie_ids":["_gat_UA-*","_gid","_ga","_ga_*","_fbp","_gcl_au","rc::c","rc::a","cookielawinfo-checkbox-advertisement","CookieLawInfoConsent","WMF-Uniq"],"cookielist":[],"non_necessary_cookies":{"necessary":["rc::c","rc::a","CookieLawInfoConsent"],"analytics":["_gat_UA-*","_gid","_ga","_ga_*"],"advertisement":["_fbp","_gcl_au"],"others":["WMF-Uniq"]},"ccpaEnabled":"","ccpaRegionBased":"","ccpaBarEnabled":"","strictlyEnabled":["necessary","obligatoire"],"ccpaType":"gdpr","js_blocking":"1","custom_integration":"","triggerDomRefresh":"","secure_cookies":""};
var cli_cookiebar_settings = {"animate_speed_hide":"500","animate_speed_show":"500","background":"#FFF","border":"#b1a6a6c2","border_on":"","button_1_button_colour":"#61a229","button_1_button_hover":"#4e8221","button_1_link_colour":"#fff","button_1_as_button":"1","button_1_new_win":"","button_2_button_colour":"#333","button_2_button_hover":"#292929","button_2_link_colour":"#444","button_2_as_button":"","button_2_hidebar":"","button_3_button_colour":"#3566bb","button_3_button_hover":"#2a5296","button_3_link_colour":"#fff","button_3_as_button":"1","button_3_new_win":"","button_4_button_colour":"#000","button_4_button_hover":"#000000","button_4_link_colour":"#333333","button_4_as_button":"","button_7_button_colour":"#61a229","button_7_button_hover":"#4e8221","button_7_link_colour":"#fff","button_7_as_button":"1","button_7_new_win":"","font_family":"inherit","header_fix":"","notify_animate_hide":"1","notify_animate_show":"","notify_div_id":"#cookie-law-info-bar","notify_position_horizontal":"right","notify_position_vertical":"bottom","scroll_close":"","scroll_close_reload":"","accept_close_reload":"","reject_close_reload":"","showagain_tab":"","showagain_background":"#fff","showagain_border":"#000","showagain_div_id":"#cookie-law-info-again","showagain_x_position":"100px","text":"#333333","show_once_yn":"","show_once":"10000","logging_on":"","as_popup":"","popup_overlay":"1","bar_heading_text":"","cookie_bar_as":"banner","popup_showagain_position":"bottom-right","widget_position":"left"};
var log_object = {"ajax_url":"https://rachaelkatiecosmetics.co.uk/wp-admin/admin-ajax.php"};
//# sourceURL=cookie-law-info-js-extra
var wc_single_product_params = {"i18n_required_rating_text":"Please select a rating","i18n_rating_options":["1 of 5 stars","2 of 5 stars","3 of 5 stars","4 of 5 stars","5 of 5 stars"],"i18n_product_gallery_trigger_text":"View full-screen image gallery","review_rating_required":"yes","flexslider":{"rtl":false,"animation":"slide","smoothHeight":true,"directionNav":false,"controlNav":"thumbnails","slideshow":false,"animationSpeed":500,"animationLoop":false,"allowOneSlide":false,"touch":false},"zoom_enabled":"1","zoom_options":[],"photoswipe_enabled":"1","photoswipe_options":{"shareEl":false,"closeOnScroll":false,"history":false,"hideAnimationDuration":0,"showAnimationDuration":0},"flexslider_enabled":"1"};
//# sourceURL=wc-single-product-js-extra
Unlock Radiant Skin: The Transformative Benefits of CO2 Laser Treatments
Your Guide to CO2 Laser Treatments
In a world where our skin faces daily challenges—from sun exposure to stress, and the natural ageing process—it’s no wonder many of us seek solutions that restore a youthful, glowing complexion. Enter CO2 laser treatments: a revolutionary approach to skincare that combines cutting-edge technology with proven results. If you’ve been considering a non-surgical way to revitalise your skin, reduce signs of ageing, or tackle stubborn scars, this might just be the treatment you’ve been waiting for. Let’s explore why CO2 lasers have become a gold standard in cosmetic dermatology.
What Are CO2 Lasers?
CO2 (Carbon Dioxide) lasers are a type of fractional laser that uses targeted light energy to precisely remove layers of damaged skin. Unlike invasive procedures, these lasers work by creating microscopic columns of thermal injury in the skin, triggering the body’s natural healing process. This stimulates collagen production and encourages the growth of fresh, healthy skin cells. Over the years, advancements like fractional CO2 laser technology have made treatments safer and more efficient, with reduced downtime compared to traditional methods (source).
1. Skin Resurfacing: Turn Back the Clock on Ageing
One of the standout benefits of CO2 lasers is their ability to resurface the skin, effectively addressing fine lines, wrinkles, and sun damage. By removing the outer layers of dull, damaged skin, the laser reveals smoother, brighter skin beneath. Think of it as a “reset button” for your complexion!
This process isn’t just superficial—it kickstarts cellular renewal, helping to improve texture and tone. Studies show that CO2 laser resurfacing can significantly reduce signs of photoaging, such as uneven pigmentation and rough texture (source). Whether you’re battling sunspots or seeking a fresher appearance, this treatment offers a scientifically backed solution.
2. Say Goodbye to Scars and Hyperpigmentation
Acne scars, surgical scars, or dark patches can linger long after the initial issue has healed, affecting confidence. CO2 lasers excel here by targeting damaged cells and encouraging the growth of new, healthy tissue. The laser’s precision ensures that only problem areas are treated, leaving surrounding skin untouched.
Research highlights its effectiveness for atrophic acne scars, with patients seeing marked improvements in skin smoothness and scar depth (source). Similarly, hyperpigmentation caused by melasma or sun exposure responds well to controlled laser energy, resulting in a more even complexion (source).
3. Boost Collagen for Firmer, Youthful Skin
Collagen—the protein responsible for skin’s elasticity—naturally declines with age, leading to sagging and wrinkles. CO2 lasers combat this by stimulating collagen production deep within the skin’s layers. As new collagen forms over weeks following treatment, you’ll notice improved firmness and a reduction in laxity.
A study published in Dermatologic Surgery found that patients experienced a 40-50% increase in collagen six months post-treatment, translating to visibly plumper, tighter skin (source).
4. Smooth Fine Lines Without Surgery
Forget the idea that only a facelift can address wrinkles. CO2 lasers offer a non-surgical alternative, particularly for delicate areas like the eyes, mouth, and forehead. By gently vaporising superficial skin layers, the laser smooths creases and encourages regeneration.
The British Association of Dermatologists notes that fractional CO2 lasers are especially effective for periorbital wrinkles (those pesky crow’s feet!) (source).
5. Minimal Downtime, Maximum Results
While CO2 lasers are more intensive than, say, a facial, modern fractional technology has slashed recovery times. Earlier CO2 treatments required weeks of downtime, but today’s fractional options limit healing to 5-7 days for most patients (source). During this period, skin may feel tender or appear pink, but this quickly subsides.
Post-treatment care is straightforward: keep skin moisturised, avoid sun exposure, and follow your specialist’s advice. Many patients find the brief recovery period a small price to pay for results that last years.
6. Versatility for Multiple Skin Concerns
Beyond ageing and scars, CO2 lasers treat a surprising range of issues:
Warts and skin growths: The laser’s precision destroys abnormal cells without harming healthy tissue.
Enlarged oil glands: Reduces the appearance of pores and controls excess oil.
Benign lesions: Safely removes moles or skin tags.
This versatility makes CO2 lasers a go-to for dermatologists addressing diverse patient needs (source).
7. Long-Lasting Results: Invest in Your Skin’s Future
Unlike topical creams that offer temporary fixes, CO2 lasers provide enduring improvements. With proper sun protection (a high-SPF sunscreen is non-negotiable!) and a solid skincare routine, results can last years. A 2020 follow-up study found that 80% of patients maintained smoother, younger-looking skin five years post-treatment (source).
Is CO2 Laser Right for You?
While CO2 lasers suit most skin types, consulting a qualified dermatologist or cosmetic specialist is crucial. They’ll assess your skin’s condition, medical history, and goals to tailor a plan—whether that’s a full resurfacing treatment or a lighter “laser peel.”
Ready to Reveal Your Best Skin?
CO2 laser treatments offer a powerful, science-backed path to radiant skin. By combining collagen stimulation, precision, and lasting results, they’re an investment in confidence and self-care. If you’re ready to explore how this transformative technology can work for you, why not book a consultation today? Your journey to glowing, rejuvenated skin starts here.
Results may vary. Always consult a certified professional before undergoing cosmetic treatments.
This article is for informational purposes only and does not constitute medical advice.
For prices and more info on the laser skin treatments available at our clinic click here.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-advertisement
1 year
Set by the GDPR Cookie Consent plugin, this cookie records the user consent for the cookies in the "Advertisement" category.
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
CookieLawInfoConsent
1 year
CookieYes sets this cookie to record the default button state of the corresponding category and the status of CCPA. It works only in coordination with the primary cookie.
rc::a
never
This cookie is set by the Google recaptcha service to identify bots to protect the website against malicious spam attacks.
rc::c
session
This cookie is set by the Google recaptcha service to identify bots to protect the website against malicious spam attacks.
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Cookie
Duration
Description
_ga
1 year 1 month 4 days
Google Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.
_ga_*
1 year 1 month 4 days
Google Analytics sets this cookie to store and count page views.
_gat_UA-*
1 minute
Google Analytics sets this cookie for user behaviour tracking.n
_gid
1 day
Google Analytics sets this cookie to store information on how visitors use a website while also creating an analytics report of the website's performance. Some of the collected data includes the number of visitors, their source, and the pages they visit anonymously.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Cookie
Duration
Description
_fbp
3 months
Facebook sets this cookie to store and track interactions.
_gcl_au
3 months
Google Tag Manager sets this cookie to experiment advertisement efficiency of websites using their services.
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
Cookie
Duration
Description
WMF-Uniq
1 year
Description is currently not available.
(function($) {
$(document).ready(function(){
var maxLength = 120;
$(".show-read-more").each(function(){
var myStr = $(this).text();
if($.trim(myStr).length > maxLength){
var newStr = myStr.substring(0, maxLength);
var removedStr = myStr.substring(maxLength, $.trim(myStr).length);
$(this).empty().html(newStr);
$(this).append('...');
$(this).append(' <a href="javascript:void(0);" class="read-more"> read more</a>');
$(this).append('<span class="more-text">' + removedStr + '</span>');
}
});
$(".read-more").click(function(){
$(this).siblings(".more-text").contents().unwrap();
$(this).remove();
});
});
//$(".page-id-39 .booking-link").attr("href", '#courses').attr('target','_self'); // Set herf value
$(".page-id-39 .booking-link").css("display", 'none');
})(jQuery);
(function($) {$(document).ready(function(){var wi = $(window).width();
if (wi <= 500) {
$('.course-content').each((i, el) => {
let $p = $(el).find('p');
$('.course-img-cont',el).insertAfter($p.eq(0)); // or use the eq here too
$('.course-img-cont').addClass('course-img-cont-mob');
});
} else {
$('.course-content').each((i, el) => {
let $p = $(el).find('p');
$('.course-img-cont',el).insertBefore($('.course-text',el)); // or use the eq here too
$('.course-img-cont').removeClass('course-img-cont-mob');
});
}
$(window).resize(function() {
//as window resizes
var wi = $(window).width();
if (wi <= 500) {
// Inserts image halfway down section
$('.course-content').each((i, el) => {
let $p = $(el).find('p');
$('.course-img-cont',el).insertAfter($p.eq(0)); // or use the eq here too
$('.course-img-cont').addClass('course-img-cont-mob');
});
} else {
// Inserts image back at the top
$('.course-content').each((i, el) => {
let $p = $(el).find('p');
$('.course-img-cont',el).insertBefore($('.course-text',el)); // or use the eq here too
$('.course-img-cont').removeClass('course-img-cont-mob');
});
}
});
});})( jQuery );
// JavaScript: Load video after the main page is ready
window.addEventListener('load', function() {
const lazyVideo = document.querySelector('.lazy-video');
const sources = lazyVideo.querySelectorAll('source');
// Set data-src to src for each source, then tell the video to load
sources.forEach(source => {
source.src = source.dataset.src;
});
lazyVideo.load();
// Optional: Add a class to fade in video after it starts playing
lazyVideo.addEventListener('loadeddata', () => {
document.querySelector('.hero-poster').style.opacity = 0;
});
});
(function($) {
$(document).ready(function(){
$('.more-info').click(function() {
$(this).closest('.treatment').find('.scg-more-info').slideToggle('fast');
let $this = $(this);
let current = $this.text();
let alternate = $this.data('alternate'); // e.g., data-alternate="Show less"
$this.text(alternate).data('alternate', current);});
});
})(jQuery);
(function($) {
$(document).ready(function(){var $header = $('header'); // Replace with your actual header selector
function toggleHeaderOnScroll() {
$header.toggleClass('scrolled', $(window).scrollTop() > 100);
}
if ($('#hero').length === 0) {
// No hero element → always add the class
$header.addClass('scrolled');
} else {
// Hero exists → toggle class on scroll
// Listen to scroll events
$(window).on('scroll', toggleHeaderOnScroll);
// Set initial state (in case page loads already scrolled)
toggleHeaderOnScroll();//toggle class on scroll with perfomrmance consideration
let ticking = false;
$(window).on('scroll', function() {
if (!ticking) {
window.requestAnimationFrame(function() {
$('header').toggleClass('scrolled', $(window).scrollTop() > 100);
ticking = false;
});
ticking = true;
}
});
}
//checks scroll on load
$(window).on('load', function() {
$(window).trigger('scroll');
});
//hero text fade out on scroll
$(window).on('scroll', function() {
if ($(this).scrollTop() > 50) {
$('.hero-cont').stop().fadeTo(800, 0); // fade to transparent
} else {
$('.hero-cont').stop().fadeTo(800, 1); // fade back to opaque
}
});
function isSticky($el) {
var stickyTop = parseInt($el.css('top')); // e.g., 0
var rect = $el[0].getBoundingClientRect();
return rect.top <= stickyTop;
}$(window).on('scroll', function() {
if (isSticky($('#serv-menu'))) {
console.log('Element is currently sticky');
$('#serv-menu').addClass('sticky');
// do something
} else {
console.log('Element is not sticky');
$('#serv-menu').removeClass('sticky');
}
});
});
})(jQuery);
(function($) {
$(document).ready(function(){
// Accordion functionality
$('.more').on('click', function() {
// Toggle active class on the question
$(this).toggleClass('active');// Toggle the answer with sliding effect
$(this).prev('.serv-more').slideToggle('fast');
let $this = $(this);
let current = $this.text();
let alternate = $this.data('alternate'); // e.g., data-alternate="Show less"
$this.text(alternate).data('alternate', current);// Update ARIA attribute for accessibility
// var expanded = $(this).attr('aria-expanded') === 'true' ? false : true;
// $(this).attr('aria-expanded', expanded);
});// Optional: allow keyboard activation (Enter or Space)
$('.more').on('keydown', function(e) {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
$(this).trigger('click');
}
});
// turn ul into w cols
$(document).ready(function() {
$('#sct-serv-list ul, #sct-serv-list ol').each(function() {
var $list = $(this);
var liCount = $list.children('li').length;
if (liCount > 5) {
$list.addClass('multi-column');
}
});
});});
})(jQuery);
(function($) {var minWidth = 1000;// Helper function to check if we are on the excluded post
function isExcludedPost() {
return $('body').hasClass('postid-1351');
}$(document).ready(function() {
// Do nothing if this is the excluded post
if (isExcludedPost()) {
return;
}var wi = $(window).width();if (wi <= minWidth) {
$('.blurb-cont').each((i, el) => {
let $p = $(el).find('p');
let mid = Math.floor($p.length / 2);
$('.blurb-img', el).insertBefore($p.eq(mid));
});
} else {
$('.blurb-cont').each((i, el) => {
let $p = $(el).find('p');
let mid = Math.floor($p.length / 2);
$('.blurb-img', el).insertAfter($('.text-cont', el));
});
}$(window).resize(function() {
// Skip resize logic if excluded post
if (isExcludedPost()) {
return;
}var wi = $(window).width();if (wi <= minWidth) {
$('.blurb-cont').each((i, el) => {
let $p = $(el).find('p');
let mid = Math.floor($p.length / 2);
$('.blurb-img', el).insertBefore($p.eq(mid));
});
} else {
$('.blurb-cont').each((i, el) => {
let $p = $(el).find('p');
let mid = Math.floor($p.length / 2);
$('.blurb-img', el).insertAfter($('.text-cont', el));
});
}
});
});})(jQuery);
jQuery(document).ready(function($) {
// JavaScript for AJAX Search with Post Type Filters
// Search triggers on: button click, Enter key, OR filter changes'use strict';
// Initialize variables
let currentPage = 1;
let searchQuery = $('#ajax-search-input').val().trim();
let selectedPostTypes = [];
let isLoading = false;
let filterChangeTimer = null;
let isInitialLoad = true;
// Get initial post types from checkboxes
function getSelectedPostTypes() {
selectedPostTypes = [];
$('input[name="post_types[]"]:checked').each(function() {
selectedPostTypes.push($(this).val());
});
// If none checked, default to both
if (selectedPostTypes.length === 0) {
selectedPostTypes = ['post', 'service'];
$('input[name="post_types[]"]').prop('checked', true);
}
return selectedPostTypes;
}
// Initialize post types
getSelectedPostTypes();
// Handle checkbox changes with debounce
$('input[name="post_types[]"]').on('change', function() {
clearTimeout(filterChangeTimer);
// If unchecking would leave no boxes checked, prevent it
if ($('input[name="post_types[]"]:checked').length === 0) {
$(this).prop('checked', true);
return;
}
selectedPostTypes = getSelectedPostTypes();
// Only trigger search if we have a search term
if (searchQuery && searchQuery.length > 0) {
filterChangeTimer = setTimeout(function() {
currentPage = 1;
performSearch(searchQuery, currentPage, selectedPostTypes);
updateBrowserURL(searchQuery, currentPage, selectedPostTypes);
}, 300); // 300ms debounce
} else {
// If no search term but we have URL parameters, update URL without search
updateBrowserURL('', 1, selectedPostTypes);
}
});
// Handle form submission (button click)
$('#ajax-search-form').on('submit', function(e) {
e.preventDefault();
triggerSearch();
});
// Handle Enter key press in search input
$('#ajax-search-input').on('keypress', function(e) {
if (e.which === 13) { // Enter key
e.preventDefault();
triggerSearch();
}
});
// Search trigger function
function triggerSearch() {
searchQuery = $('#ajax-search-input').val().trim();
currentPage = 1;
if (searchQuery.length > 0) {
performSearch(searchQuery, currentPage, selectedPostTypes);
updateBrowserURL(searchQuery, currentPage, selectedPostTypes);
} else {
showSearchIntro();
updateBrowserURL('', 1, selectedPostTypes);
}
}
// Handle AJAX pagination clicks
$(document).on('click', '.ajax-page-link', function(e) {
e.preventDefault();
if (isLoading) return;
currentPage = $(this).data('page');
performSearch(searchQuery, currentPage, selectedPostTypes);
updateBrowserURL(searchQuery, currentPage, selectedPostTypes);
$('html, body').animate({
scrollTop: $('#search-results').offset().top - 100
}, 500);
});
// Handle browser back/forward buttons
if (window.history && window.history.pushState) {
window.addEventListener('popstate', function(event) {
if (event.state && event.state.search) {
searchQuery = event.state.search;
currentPage = event.state.page || 1;
selectedPostTypes = event.state.post_types || ['post', 'service'];
$('#ajax-search-input').val(searchQuery);
// Update checkboxes
$('input[name="post_types[]"]').each(function() {
$(this).prop('checked', selectedPostTypes.includes($(this).val()));
});
performSearch(searchQuery, currentPage, selectedPostTypes);
} else if (!event.state || !event.state.search) {
showSearchIntro();
}
});
}
// Perform AJAX search
function performSearch(query, page, postTypes) {
if (isLoading) return;
isLoading = true;
$('.search-loader').css('opacity', '1');
$('#search-submit-btn').prop('disabled', true);
// Add visual feedback for active search
$('.filter-checkbox').addClass('searching');
$.ajax({
url: ajax_search_params.ajax_url,
type: 'POST',
data: {
action: 'ajax_search',
nonce: ajax_search_params.nonce,
query: query,
page: page,
posts_per_page: 10,
post_types: postTypes
},
success: function(response) {
if (response.success) {
$('#search-results').html(response.data.results);
if (response.data.pagination) {
$('#search-pagination').html(response.data.pagination).show();
} else {
$('#search-pagination').hide();
}
// Update active filters display
updateActiveFiltersDisplay();
} else {
$('#search-results').html('<div class="no-results"><p>' + response.data + '</p></div>');
$('#search-pagination').hide();
}
},
error: function(xhr, status, error) {
$('#search-results').html('<div class="error"><p>An error occurred. Please try again.</p></div>');
$('#search-pagination').hide();
console.error('Search error:', error);
},
complete: function() {
isLoading = false;
$('.search-loader').css('opacity', '0');
$('#search-submit-btn').prop('disabled', false);
$('.filter-checkbox').removeClass('searching');
// If this was initial load from URL parameters, mark as done
if (isInitialLoad) {
isInitialLoad = false;
}
}
});
}
// Update active filters display
function updateActiveFiltersDisplay() {
let activeFilters = [];
// Define filter labels
const filterLabels = {
'post': 'Articles',
'service': 'Treatments'
};
// Get active filters based on checkboxes
$('input[name="post_types[]"]:checked').each(function() {
const type = $(this).val();
if (filterLabels[type]) {
activeFilters.push(filterLabels[type]);
}
});
// Update or create active filters display
let activeFiltersElement = $('.active-filters');
if (activeFiltersElement.length === 0) {
activeFiltersElement = $('<div class="active-filters"></div>');
$('.results-header').append(activeFiltersElement);
}
if (activeFilters.length > 0) {
activeFiltersElement.html('<span class="filter-badge">' + activeFilters.join(', ') + '</span>');
} else {
activeFiltersElement.empty();
}
}
// Update browser URL without reloading
function updateBrowserURL(query, page, postTypes) {
if (!window.history || !window.history.pushState) return;
let newURL = window.location.protocol + "//" + window.location.host + window.location.pathname;
let params = [];
if (query) {
params.push('s=' + encodeURIComponent(query));
}
if (page > 1) {
params.push('paged=' + page);
}
// Only add post_types parameter if not showing all types
// But we need to track what's actually selected
if (postTypes && postTypes.length > 0) {
if (postTypes.length === 1) {
// Only one type selected
params.push('post_types[]=' + encodeURIComponent(postTypes[0]));
} else if (postTypes.length === 2) {
// Both selected - we could still include it for clarity, or omit
// Let's include it so URL reflects actual selection
postTypes.forEach(function(type) {
params.push('post_types[]=' + encodeURIComponent(type));
});
}
}
if (params.length > 0) {
newURL += '?' + params.join('&');
}
window.history.pushState({
search: query,
page: page,
post_types: postTypes
}, '', newURL);
// Update page title
if (query) {
let baseTitle = document.title.split('|')[0] || 'Search Results';
document.title = baseTitle.trim() + ' for: ' + query;
} else {
document.title = 'Search' + (document.title.includes('|') ? ' | ' + document.title.split('|').slice(1).join('|') : '');
}
}
// Show search intro message
function showSearchIntro() {
$('#search-results').html(
'<div class="search-intro">' +
'<p>Search through our articles and treatments. Use the filters above to refine your search.</p>' +
'<p>You can search by keyword, treatment name, or article content.</p>' +
'</div>'
);
$('#search-pagination').hide();
}
// Add visual indicator when checkbox triggers search
function setupFilterCheckboxStyles() {
const style = document.createElement('style');
style.textContent = `
.filter-checkbox.searching .checkmark {
border-color: #0073aa;
background-color: rgba(0, 115, 170, 0.1);
}
.filter-checkbox.searching input:checked ~ .checkmark {
background-color: #0073aa;
}
`;
document.head.appendChild(style);
}
// Initialize
$(window).on('load', function() {
// Setup visual styles
setupFilterCheckboxStyles();
// Trigger AJAX search if we have initial search term on page load
if (searchQuery && searchQuery.length > 0) {
setTimeout(function() {
performSearch(searchQuery, currentPage, selectedPostTypes);
}, 100);
}
// Add visual feedback for checkboxes
$('input[name="post_types[]"]').on('mousedown', function() {
$(this).closest('.filter-checkbox').addClass('clicking');
}).on('mouseup mouseleave', function() {
$(this).closest('.filter-checkbox').removeClass('clicking');
});
});})(jQuery);
var ajax_search_params = {
ajax_url: 'https://rachaelkatiecosmetics.co.uk/wp-admin/admin-ajax.php',
nonce: '0b568a8001'
};
var sbiajaxurl = "https://rachaelkatiecosmetics.co.uk/wp-admin/admin-ajax.php";