Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hello,
I need help moving my search bar to the left of my logo. I need this for my desktop view.
My url is designsfordivine.com
I would appreciate any help,
Thanks,
Hi @omero
This is Noah from PageFly - Shopify Page Builder App
Please add this code to your theme.liquid above the </head> to get this solved
Step 1: Online Stores > Themes > More Actions > Edit code
Step 2: click on theme.liquid and paste the code above the </head>
<style>
@media screen and (min-width: 767px){
.template-search__search {
margin: 0 !important;
}
}
</style>
Hope this can help you solve the issue
Best regards,
Noah | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
PageFly - #1 Page Builder for Shopify merchants.
All features are available from Free plan. Live Chat Support is available 24/7.
Thanks for your reply but this is the look I want to achieve
Got you, now you can try this:
<script>
function isDesktop() {
return window.innerWidth > 768; // Adjust the breakpoint as needed
}
// Your code to move the element
let pfInterval;
if (isDesktop()) {
pfInterval = setInterval(() => {
const search = document.querySelector('.template-search__search');
const searchBlock = document.querySelectorAll('details-modal.header__search')[1];
if (search && searchBlock) {
clearInterval(pfInterval);
searchBlock.appendChild(search); // Using appendChild to move the element
}
}, 100);
setTimeout(() => {
clearInterval(pfInterval);
}, 5000);
}
</script>
<style>
@media screen and (min-width: 767px){
svg.modal__toggle-open.icon.icon-search {
display: none;
}
}
</style>
With the same instructions above please
Please let me know if it works by giving it a Like or marking it as a solution!
PageFly - #1 Page Builder for Shopify merchants.
All features are available from Free plan. Live Chat Support is available 24/7.
Hi @omero
You can achieve the following edits by following the instructions below.
@media only screen and (min-width: 975px) {
.template-search__search {
max-width: 27rem;
top: -17rem;
position: absolute;
z-index: 10;
width: 100%;
left: 6rem;
}
.header details-modal.header__search {
display: none;
}
}
@media only screen and (min-width: 1350px) {
.template-search__search {
max-width: 30rem;
top: -13rem;
}
}
@media only screen and (max-width: 980px) {
.template-search__search {
display: none
}
}
Result here:
I hope it help.
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
Thanks I added the code in base.css but
1- now there is green area between header and main content in mobile view.
2- the search bar disappeared on desktop view
Hi @omero ,
This is David at SalesHunterThemes.
Thank you for your question.
You can try to follow these steps:
Go to Online Store -> Themes -> Actions -> Edit code.
Go Assets folder -> theme.liquid file.
Add the following code in the bottom of the file above </body> tag
<style>
@media (min-width: 767px) {
.template-search .template-search__search {
margin-left: 0;
}
}
</style>
If I managed to help you then, don't forget to Like it and Mark it as Solution!
Hopefully, this proves useful.
David | SalesHunterThemes team
We create fast Shopify themes, focusing on exceptional performance and seamless experience across all devices.
Try our Electro theme Free! (Now at Black Friday price)
thanks for your reply, I need help placing here
Hi @omero ,
You can try to follow these steps:
Go to Online Store -> Themes -> Actions -> Edit code.
Go Assets folder -> theme.liquid file.
Add the following code in the bottom of the file above </body> tag
<style>
@media (min-width: 767px) {
.template-search .template-search__search {
position: absolute;
top: 5px;
z-index: 3;
left: 2%;
}
.header .header__search {
display: none;
}
}
</style>
If I managed to help you then, don't forget to Like it and Mark it as Solution!
Hopefully, this proves useful.
David | SalesHunterThemes team
We create fast Shopify themes, focusing on exceptional performance and seamless experience across all devices.
Try our Electro theme Free! (Now at Black Friday price)