All things Shopify and commerce
How would I do to expand the search bar in publisher theme ?
Solved! Go to the solution
This is an accepted solution.
Step 1. Go to Admin -> Online store -> Theme > Edit code
Step 2. Find the file base.css. Search for the following CSS snippet
@media screen and (min-width: 990px) {
.header--top-left, .header--middle-left:not(.header--has-menu) {
grid-template-areas:
'heading icons'
'navigation navigation';
grid-template-columns: 1fr auto;
}
}
Please change to it
@media screen and (min-width: 990px) {
.header--top-left, .header--middle-left:not(.header--has-menu) {
grid-template-areas:
'heading searchbar icons'
'navigation navigation navigation';
grid-template-columns: 1fr 1fr 1fr;
}
.header__search {
display: none !important;
}
}
Step 3. Find the file theme.js or global.js. Add the following JS snippet
(() => {
if(window.innerWidth > 750) {
let checkExistInterval = setInterval(function() {
let heading = document.querySelector(".header__heading");
let predictiveSearch = document.querySelector("predictive-search");
if (heading && predictiveSearch) {
heading.insertAdjacentElement("afterend", predictiveSearch);
clearInterval(checkExistInterval);
}
}, 100);
setTimeout(function() {
clearInterval(checkExistInterval);
}, 10000);
}
})()
Result
If it helps you, please like and mark it as the solution.
Best Regards
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
Hi @masudamc20, Can you kindly share your store link with us? We will check it and suggest you a solution if possible.
Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges: Get more sales with striking labels, badges, and banners from our 10,000+ available templates.
BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
Hi @masudamc20,
Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code
Step 2: Search file theme.liquid
Step 3: Inside head tags. You need create style tags. After insert my code inside style tags
@media only screen and (min-width: 990px) {
.search-modal__form {
max-width: 100% !important;
}
}
Here is result:
Hope this can help you,
If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍
Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges: Get more sales with striking labels, badges, and banners from our 10,000+ available templates.
BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
hi @masudamc20
Step 1. Go to Admin -> Online store -> Theme > Edit code
Step 2. Find the file base.css. Search for the following CSS snippet
@media screen and (min-width: 990px) {
.search-modal__form {
max-width: 74.2rem;
}
}
Please change to it
@media screen and (min-width: 990px) {
.search-modal__form {
}
}
Result
If it helps you, please like and mark it as the solution.
Best Regards
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
Dear, I have done as you have suggested. But things still unchanged.
oh sorry
Please use this code snippet
@media screen and (min-width: 990px) {
.search-modal__form {
max-width: 100% !important;
}
}
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
yes. I have done. still the problem exist.
I've noticed the search bar has extended. What other issues are remaining?
Are you looking to expand the height of the search bar?
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
I want the search bar is visible always as the picture attached. thank you for your continuous support with patience.
This is an accepted solution.
Step 1. Go to Admin -> Online store -> Theme > Edit code
Step 2. Find the file base.css. Search for the following CSS snippet
@media screen and (min-width: 990px) {
.header--top-left, .header--middle-left:not(.header--has-menu) {
grid-template-areas:
'heading icons'
'navigation navigation';
grid-template-columns: 1fr auto;
}
}
Please change to it
@media screen and (min-width: 990px) {
.header--top-left, .header--middle-left:not(.header--has-menu) {
grid-template-areas:
'heading searchbar icons'
'navigation navigation navigation';
grid-template-columns: 1fr 1fr 1fr;
}
.header__search {
display: none !important;
}
}
Step 3. Find the file theme.js or global.js. Add the following JS snippet
(() => {
if(window.innerWidth > 750) {
let checkExistInterval = setInterval(function() {
let heading = document.querySelector(".header__heading");
let predictiveSearch = document.querySelector("predictive-search");
if (heading && predictiveSearch) {
heading.insertAdjacentElement("afterend", predictiveSearch);
clearInterval(checkExistInterval);
}
}, 100);
setTimeout(function() {
clearInterval(checkExistInterval);
}, 10000);
}
})()
Result
If it helps you, please like and mark it as the solution.
Best Regards
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
this solution is working. thank you again! you are a real expert on shopify.
Hi i see this is something i would like to have on my site. Could you please help me for which solution i need to make my search bar long and in the centre here is my site url angrysuzy.co.uk
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025