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
We offer a range of botox and dermal filler treatments from our clinic near Portsmouth. Dermal Fillers ‘fill in” and “plump up” areas that have lost volume and firmness due to loss of fatty tissues through ageing.
Dermal fillers can also be used to contour the face by creating higher cheek bones, sharpen the jawline, add chin definition, straighten nose humps, lift the nose tip, plump the lips and fill wrinkles.
Botulinum Toxin or “Botox” is a great option if you’re looking to smooth out fine lines and wrinkles. It is injected superficially and freezes the muscles in that particular area that cause deep lines and wrinkles on movement.
Botox injections also reduces pore size and help with excess sweating.
Our clinic is only 30 minutes drive from Portsmouth.
Enhance your natural beauty with our dermal filler treatments. We restore lost volume, smooth wrinkles, and define facial contours for a refreshed, youthful appearance. Experience natural-looking results.
Treatment areas include:
Lips
Nasolabial Folds
Marionette lines
Frown Lines
Cheeks
Jawline
Tear Troughs
Chin
Smokers Lines
Smile Lines
Liquid Rhinoplasty (nose reshaping)
Wrinkles On Rest
Temple Filler
Dermal Filler treatments and more are available at our clinic today
more info
Botox Injections
Prices from £99
Smooth away fine lines and wrinkles with our expert Botox injections. We gently relax facial muscles to soften expression lines, preventing aging for a natural, refreshed, and youthful look. Safe, effective treatment.
Treatment areas include:
Forehead
Frown Lines
Crows Feet
Bunny Lines
Smokers Lines
Gummy Smile
Lip Flip
Nose Tip Lift
Dimple Chin
Under Eyes
Plasma band
Calf slimming
Masseter (jaw muscle)
Hyperhidrosis (underams)
Anti-wrinkle treatments and more are available at our clinic today!
more info
Radiesse
Rejuvenate your skin with Radiesse
Rejuvenate your skin with Radiesse. This innovative treatment stimulates collagen production while adding volume, smoothing moderate to severe wrinkles and restoring facial contours for a naturally youthful, long-lasting lift.
Radiesse is a cutting-edge dermal filler designed to restore lost volume, smooth wrinkles, and stimulate your skin's natural collagen production. This advanced treatment uses calcium hydroxyapatite to deliver long-lasting, natural-looking results, enhancing your facial contours and giving you a refreshed, youthful appearance.
At our clinic, our team of experts provides personalised and safe Radiesse treatments, tailored to your unique needs, so you can enjoy radiant, younger-looking skin with confidence.
Radiesse can treat the following areas:
Face
Neck
Hands
Chest
more info
Dermal Filler FAQ's
Does it hurt?
Numbing agent is applied to the area to make the experience more comfortable.
Are dermal fillers safe?
Dermal fillers are safe in the correct hands as they are dissolvable unlike old products. They are now made using hyaluronic acid (which your body produces naturally). The dermal filler we use is soft so there will be less risk of leaving lumps. Bruising and swelling are common side effects.
Can I be in the sun after my treatment?
Avoid sunbathing and sun beds, always use factor 50 on your face to prevent early signs of ageing.
Can I smoke after my treatment?
Smoking is not recommended for 4 hrs after your lip filler treatment. Smoking is fine if you are treating another area.
Can I drink alcohol before or after my treatment?
Drinking alcohol is not recommended for 48 hours before & after your treatment because it slows down the healing process meaning swelling and bruising will be present for longer.
Can I wear makeup after my treatment?
Makeup is not recommended for 4 hours after your treatment. Makeup should then be applied using clean brushes to prevent any infection.
Can lip filler cause cold sores?
If you suffer from cold sores I would recommend taking oral medication 7 days before and after your treatment to prevent an outbreak.
Will I bruise?
Bruises can occur after your treatment, usually lasting 2-14 days. Arnica tablets taken 7 days prior to your treatment can help to prevent bruising.
Will I swell?
You will be tender and maybe swollen for 2-14 day. For lip filler treatments you are likely to experience more swelling for the first 3 days.
Can I take a flight after my treatment?
You cannot fly for 14 days after your treatment as it will increase any swelling you may have.
When will I see results?
Dermal filler results are instant but swelling means that you won’t see the true results until 2-4 weeks after your treatment.
How old do I need to be to have dermal filler?
Dermal filler is becoming increasingly popular among young people because it’s a safe, non-surgical process that can be used to contour and change the face shape such as creating more prominent cheekbones and jawlines. Our minimum age for treatment is 18.
How long will me treatment take?
It depends on your treatment plan, 1.1ml – 6.6ml usually takes between 15-90 minutes.
Can I work out after my dermal filler treatment
We advise you to avoid excessive sweating for 7 days after treatment.
Botox FAQ's
Does it hurt?
Botox is a slight sting, but it’s over very quickly.
Is Botox safe?
There are minimal side effects with anti-wrinkle injections. Drooping eyelids is probably the most common but can be avoided with good placement of the injections and can be corrected. Please ensure your practitioner is experienced. Although it is classed as a toxin and is a prescription only medicine, after many studies there is no evidence of any long term side effects.
Will I bruise?
Very little bruising can occur, but not often.
Can I sunbathe after Botox?
Avoid hot direct sunlight on the area for 14 days after your treatment.
When will I see results?
Between 2-14 days after your treatment.
Is a top up included?
Yes I offer a free top up, only if needed.
How old do I have to be to have Botox?
From the age of 18, I would recommend starting before deep wrinkles occur.
What is Botox used for?
Botox can also be used to lift the brows, create a nose tip lift, reduce sweating, stop teeth grinding.
Can I take a flight after Botox?
Yes flying is fine.
Can I lay down after Botox?
Laying down is not recommended for four hours after your treatment.
Can I wear makeup after Botox?
Makeup is not recommended for 4 hrs after your treatment, until the injection points are closed over to prevent infection.
Can I go to the gym after Botox?
Avoid excessive sweating for 7 days after treatment.
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";