This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Hiding Search Bar

#51698
KimberlyAllenKimberlyAllen
Participant

Hi Ernest,

We have tried the above code but it doesn’t seem to remove any search boxes from any of the pages.

Is it because on every page the first part of the if statement will always be true?

I did try flipping the if statements as below but that again hides all search boxes on the 2 pages (13702 and 2428)

if ( get_the_ID() == 13702 || get_the_ID() == 2428 ) {
		return '';
	}
	if ( $id != 1 ) {
		return $output;
	}
	
	return $output;
}, 10, 2 );