• Resolved netschmiede24

    (@netschmiede24)


    Hi there,

    I have placed my WordPress installation in a “new” folder on my server. So the WordPress address is domain.com/new – while the web address is domain.com . Now the search icon in the header bar produces wrong results, as it always goes to domain.com/new?s=item – how can I remove the “/new” in these results?

    The search in the sidebar widget is working just fine.

    Thanks,
    Astrid

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi Astrid

    Thanks for posting your question.

    There is most likely a CORS error as a result of assets being loaded from a different domain. You can confirm the issue by checking the console, here is how. If that is the issue you can find more information on the problem here.

    If you’d like us to take a look, please, send a link to your site and we’ll take a look. You can also update your support thread and use the URL field in the form provided which hides the URL from logged-out users.

    Thread Starter netschmiede24

    (@netschmiede24)

    No, it is not a CORS error. This is not a different domain, but a subdirectory of the same domain!

    As long as I developped the site on domain.com/new the search icon worked perfectly. But after I published the site by redirecting the index.php in the root to the subdirectory, the search from the top bar doesn’t work anymore, as it displays the results still from the /new subdirectory.

    I looked at the source code from the overlay page that opens, when you click the search icon. This has the following code:

    <form id="fullscreen-search-form" method="get" action="https://domain.com/new">
    								<input type="search" name="s" placeholder="" aria-label="Search for" value="keyword" />
    								<button type="submit" aria-label="Search">
    												<svg version="1.1" xmlns="https://www.w3.org/2000/svg" width="26" height="28" viewBox="0 0 26 28">
    				<path d="M18 13c0-3.859-3.141-7-7-7s-7 3.141-7 7 3.141 7 7 7 7-3.141 7-7zM26 26c0 1.094-0.906 2-2 2-0.531 0-1.047-0.219-1.406-0.594l-5.359-5.344c-1.828 1.266-4.016 1.937-6.234 1.937-6.078 0-11-4.922-11-11s4.922-11 11-11 11 4.922 11 11c0 2.219-0.672 4.406-1.937 6.234l5.359 5.359c0.359 0.359 0.578 0.875 0.578 1.406z"></path>
    			</svg>
    										</button>
    							</form>

    It probably should be action=”https://domain.com&#8221; instead of action=”https://domain.com/new&#8221; – so how can this be fixed?

    Hi Astrid,

    Please open your website and navigate to Settings > General and check your URLs are set to the correct values. If they’re correct, do you by any chance have a public URL where I can take a look at the issue? This would be the best way for me to diagnose what’s going on.

    Kind regards,
    Alex

    Thread Starter netschmiede24

    (@netschmiede24)

    Hi Alex,

    yes, the URLS in Settings > General are set to the correct values. As I stated in my first post, the WordPress URL is domain.com/new – the Web URL is domain.com . I usually use method II from this article. https://www.ads-software.com/support/article/giving-wordpress-its-own-directory/

    I cannot give you the actual URL where I have first experienced the issue with the search icon – but I have just set up a fresh test install on a different unused domain with the basics – and it shows the same thing.

    Please look at https://www.nolde-gallasch.de and perform any search with the search icon in the top bar. It will lead you to nolde-gallasch.de/wp-neu/?s=… – whereas a search in the sidebar search field will correctly lead you to nolde-gallasch.de/?s=…

    Hope this now makes it clearer?

    Thanks,
    Astrid

    Hi Astrid,

    Thank you for clarifying. I’ve had a look at your website and it appears your Site URL is set to nolde-gallasch.de/wp-neu and your WordPress Address is set to nolde-gallasch.de/. I say this because your markup is referencing the incorrect URLs, and not the correct one. Can you please show me a screenshot of your settings?

    if your settings are set like this, please change the URLs over.

    Kind regards,
    Alex

    Thread Starter netschmiede24

    (@netschmiede24)

    It’s the other way round. Site URL is nolde-gallasch.de and WordPress Address is nolde-gallasch.de/wp-neu .
    See here: https://imgur.com/a/UIpsojj

    This is how it is explained in https://www.ads-software.com/support/article/giving-wordpress-its-own-directory/ (Method II)

    Like I said – it’s only the search icon in the top bar that goes to the wrong URL – the search in the sidebar works just fine! The search icon is referencing to the wrong address.

    All the best,
    Astrid

    Thread Starter netschmiede24

    (@netschmiede24)

    I think I found it. Line 83 of header.php should be
    <form id="fullscreen-search-form" method="get" action="<?php echo esc_url( home_url() ) ?>">

    Currently it is
    <form id="fullscreen-search-form" method="get" action="<?php echo esc_url( site_url() ) ?>">

    I changed this line in another installation – and now it works just fine. Please update the theme!

    Thanks,
    Astrid

    Hi Astrid,

    Thank you for the information. I’ve forwarded it to the rest of the team and this should be fixed in a future theme update.

    Kind regards,
    Alex

    Thread Starter netschmiede24

    (@netschmiede24)

    Thanks! Great theme btw!

    Hi Astrid

    Thanks for raising this issue. I’ll close this thread now. If any SiteOrigin related questions arise in the future, please, let us know.

    Cheers for now ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Search icon not working’ is closed to new replies.