Jump to content

Add Search Option to Header

Recommended Posts

  • Replies 7
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

4 minutes ago, sian75 said:

Hi! Is there a way to add a search option with an icon in the header? I need my site visitors to able to search older blog posts quickly. Thanks!

Yes, Add the search block in the footer. Then share your website URL. I'll provide code to move the search block on the header.

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment
32 minutes ago, sian75 said:

I have added the search bar to the footer. 

Add these code on Code Injection panel in Website Utilities Website Tools > Code Injection. Add on the header section.

<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script>
$(function(){
  let searchBlock = $('.fe-block-yui_3_17_2_1_1705197484910_36207 .sqs-block').attr('id','').addClass('header-search-bar');
  
 $(searchBlock).appendTo($('.header-display-desktop .header-actions--right'));
  $(searchBlock).clone().insertBefore($('.header-menu-actions .header-menu-actions-action'));
  })
</script>

 

Screenshot_29.png

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment

About me: I'm Paul, a SQSP user for over 18 yrs and a Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL, providing high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji below. Buying a coffee is optional.

Book paid help with domains: Connect a GoDaddy domain. Connect a Squarespace Domain. Domain assistance

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.