Forum Replies Created
-
AuthorPosts
-
KimberlyAllen
ParticipantHi Ernest,
You are correct I did ask about prioritising results but thought I had removed them all. I will go back and check. Thanks for your help. Please feel free to close this ticket
Kind regards
KimberlyAllen
ParticipantThis is great thank you Ernest, works perfectly
KimberlyAllen
Participantnot header.php or page.php
KimberlyAllen
Participantand to confirm this is adding the code into functions.php
KimberlyAllen
Participantis it possible to write a piece of code that tells the system to always display [wd_asp id=1] (header search) unless on page ID’s 13702 and 2428 then instead display [wd_asp id=3] and [wd_asp id=5] respectively?
KimberlyAllen
ParticipantThanks Ernest, can you think of reasons why both searches are being removed from page ID 2428 when using this code?
KimberlyAllen
ParticipantThat is correct, the search that sits within the header is ID 1, the search that sits on page ID 2428 is 5 and the search that sits on page ID 13702 is wd-asp id=5
KimberlyAllen
ParticipantHi 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 );KimberlyAllen
ParticipantHi Ernest,
I am so sorry for this query, before I start looking into plugins can you check one thing for me, is it possible for the main header search to stay visible through the site apart from pages 13702, and 2428?
On these pages instead I need their individual searches as shown on the last screenshot?
KimberlyAllen
ParticipantThanks Ernest, I have tried this new code and nothing changes.
I am just wondering if it would be easier to have header search appear everywhere on the site except from two pages that have other ajax searches on. Is this possible?
So for example from the web link sent before the only pages I wouldn’t want the header menu search to be visible would be on the All courses and Video Help Guides pages.
Can this be done?
KimberlyAllen
ParticipantHi Ernest,
Thank you for the code. I have tested added this to functions.php and it seemed to work ok in terms of hiding the search box from all pages other than the home page. However, the side affect to this was that it also hid my other search boxes.
Please see attached screenshot for one of my pages which has 2 search boxes. https://sla.thespencergroup.co.uk/video-tutorials/
Would it be possible to tweak the code so the 2nd search box still remains active?
Thanks
KimberlyAllen
Participant -
AuthorPosts