Changing 404 search option to Xstore search

This topic has 3 replies, 2 voices, and was last updated 2 years, 6 months ago ago by Olga Barlow

  • Avatar: Niddy
    Niddy
    Participant
    June 15, 2022 at 12:46

    Hi,

    As per the title. Is it possible to use the Xstore search widget on the 404 error page instead of the default search?

    So what I mean is can you use your search instead of the default search on the 404 page?

    Reason being the search results page looks awful but yours is much nicer so it makes sense to use your search all the time. Obviously I could edit the 404 template and add a custom block element to it but I’m asking if it’s already an option or if it’s possible to do it as standard on a future update as nobody really likes / uses the default WordPress search.

    So this is default search query – /?s=Xstore

    And this is yours (that I want on 404 page) – /?s=Xstore&post_type=product&et_search=true

    Thanks

    2 Answers
    Avatar: Niddy
    Niddy
    Participant
    June 15, 2022 at 13:47

    Just an update – I have managed to do this manually and it works well.

    For the benefit of others, I first created a new widget (/wp-admin/widgets.php) called 404 Search and then added the Xstore search widget to it, then saved this.

    Then I created a new static block (/wp-admin/edit.php?post_type=staticblocks) and created my page layout, then added the widget into the correct place using the WPBakery Widgetised Sidebar element.

    Copy the new static block code (i.e. [block id=”6400″] ) and paste it in Xstore theme options -> 404 page in the content box.

    My 404 is now fully customised exactly how I want it and it uses the search option I wanted too.

    Very easy once I sat and thought about it. 🙂

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    June 15, 2022 at 14:24

    Hello,

    Glad to hear that you sorted out! Have a good day.

    Regards

  • Viewing 3 results - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.