-
AuthorPosts
-
July 20, 2019 at 7:15 pm #1120467
Hi
I’ve tried different options based on articles you have about adding widgets to headers.
I already have a header widget with a text widget for an h1 custom title “SilviaFindings, Canada”.
The second widget I want to add is the WooCommerce Predictive Search widget and position it at the end of the secondary menu just before the social media icons. I need help to figure this layout/positioning issue because no matter what I try, the search box/icon is always in the center of the header.Much appreciate any help you can give me.
Thanks
LyseJuly 21, 2019 at 12:45 am #1120531Hey tremblayly,
Please link to the page so we can examine the issue.Best regards,
MikeJuly 21, 2019 at 5:04 am #1120564Sorry
https://silviafindings.staging.wpengine.com/Thank you
LyseJuly 21, 2019 at 10:11 am #1120584Hi,
Please try the following in Quick CSS under Enfold->General Styling:
#text-6 { left: 0; transform: translate(0%); }
Best regards,
RikardJuly 21, 2019 at 7:56 pm #1120689Hi Rikard,
That just move up both widget higher.
I want the text “SilviaFindings, Canada” to stay the same and looking to position the search bar/icon at the end of secondary menu between the last menu item and the first social icon.Thanks
LyseJuly 21, 2019 at 8:36 pm #1120694Hi Rikard,
Here’s something code snippet I tried that is similar to what I’m trying do do:
I created the following CSS to position the WC Predictive Search search bar/icon:
.wc_ps_sidebar_container {
width: calc(100% – 0px – 0px – 2px)!important;
}
I’m left with some positioning and width issue on wider screens and small iphone portrait screens.Any suggestions on how to get the width of this container to displays wider on large screen and to a reasonable width on small screens?
THanks
LyseJuly 23, 2019 at 2:57 am #1121084Hi,
Thank you for the update.
Try to remove the margin around the container on mobile view with this css code.
@media only screen and (max-width: 767px) { .wc_ps_sidebar_container { margin: 0; } }
Best regards,
IsmaelJuly 23, 2019 at 5:55 pm #1121241Hi Ismael,
I’ve added margins as follows:
@media only screen and (max-width: 767px) {
.wc_ps_sidebar_container {
margin: 5px 10px 0px 0px;}
.wc_ps_sidebar_container {
width: calc(150% – 0px – 0px – 2px)!important;
}
But how do I increase the size of the search widget container on larger screens. I tried adding the width: width: calc(150% – 0px – 0px – 2px)!important; to the smaller devices screen size and increase the width of the container by changing calc(200% – 0px – 0px – 2px)!important; to 200%. That does not work because it gets applied to the smaller screen as well. So how can I have the search widget container wider on wide screens and smaller on small screens?Thanks
LyseJuly 25, 2019 at 2:50 pm #1121917Hi,
Thank you for the update.
Can you provide a screenshot of the issue or what you’re trying to change? The css code above should remove the margin around the search field on mobile view. I’m not really sure why you’re trying to get it back.
Best regards,
IsmaelJuly 25, 2019 at 3:47 pm #1121930Hi Ismael,
1) Screenshot of what the search bar looks like on my iphone using .wc_ps_sidebar_container {width: calc(150% – 0px – 0px – 2px)!important;}
https://www.dropbox.com/s/17ux6h7bft564pc/search%20bar%20on%20iphone%20100.jpg?dl=02) Screenshot of what this CSS code looks like on my large monitor:
https://www.dropbox.com/s/gcqtmne3e9ehyw4/search%20bar%20too%20small%20large%20screen.png?dl=03) Screenshot of changing the CSS to .wc_ps_sidebar_container {width: calc(280% – 0px – 0px – 2px)!important;}
https://www.dropbox.com/s/gcqtmne3e9ehyw4/search%20bar%20too%20small%20large%20screen.png?dl=0Screenshot (3) is what I want to see on the larger screens
Screenshot (1) I want to keep when on smaller screen sizesHope this clarifies what I’m trying to accomplish.
Lyse
July 26, 2019 at 4:40 am #1122051Hi,
Thank you for the screenshots.
Remove the previous css code and replace them with the following. That should remove the margin around the search field on mobile view and increase its size on desktop view.
@media only screen and (min-width: 989px) { .wc_ps_sidebar_container { width: calc(150% – 0px – 0px – 2px)!important; } } @media only screen and (max-width: 767px) { .wc_ps_sidebar_container { margin: 0; } }
Adjust the value as necessary.
Best regards,
IsmaelJuly 26, 2019 at 4:52 pm #1122184Hi Ismael,
I got it to work after making the following changes:
@media only screen and (max-width: 767px) {
.wc_ps_sidebar_container {
width: 320px!important;
margin: 2px 2px 2px 5px!important;
}
}
@media only screen and (min-width: 989px) {
.wc_ps_sidebar_container {
width: 350px!important;
margin: 10px 10px 10px 285px!important;
}
}Thank you so much, you’ve been extremely helpful and patient.
LyseJuly 26, 2019 at 5:02 pm #1122188Hi Ismael,
One more thing, with this code, on the smaller devices, this hides the phone # that is part of the secondary menu because it gets displayed on the next line on smaller devices. Is there a way to get the phone # to show on the same line as the secondary menu?
Thanks
LyseJuly 27, 2019 at 5:12 pm #1122371Hi,
Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:.phone-info.with_nav span { margin-top: 20px !important; }
Best regards,
MikeJuly 27, 2019 at 6:01 pm #1122403Hi Mike,
That worked perfectly. I’ve tested this on my staging server, but when I go to my live site: https://silviafindings.com/ I don’t see my search bar at all (on PC and mobile devices). My PC was turned off all night.
Any clue why this is not working on my production site?
Thanks
LyseJuly 27, 2019 at 9:54 pm #1122441Hi,
I took a look at your search widget in your sidebar and found that widget contains a style “display:none” please check.
Please see the screenshot in Private Content area.Best regards,
MikeJuly 27, 2019 at 10:19 pm #1122444Hi Mike,
I have the same settings on my staging server, yet the search bar displays
Lyse
July 27, 2019 at 10:24 pm #1122446Hi Mike,
You’ll also see that my search bar in the widget area now displays incorrectly. I will be removing all of search bar widgets I’ve created but until this issue is fixed I can remove the search function. So would need temporary fix.
Lyse
July 27, 2019 at 11:29 pm #1122452Hi,
Please try to find this css in your custom styles:@media only screen and (min-width: 989px) { .wc_ps_sidebar_container { width: 350px!important; margin: 10px 10px 10px 285px!important; } }
and replace with this css:
@media only screen and (min-width: 989px) { .wc_ps_sidebar_container { width: 100%!important; margin: 10px 10px 10px 0px!important; } }
Please see the screenshot in Private Content area of the expected results.
Best regards,
MikeJuly 28, 2019 at 12:34 am #1122453Hi Mike,
I changed the code like this instead because the previous suggestion had the search bar in the header not displaying correctly:
/*position container as part of secondary menu */@media only screen and (min-width: 989px) {
.wc_ps_sidebar_container {
width: 350px!important;
margin: 10px 10px 10px 285px!important;
}
}
@media only screen and (min-width: 989px) {
.avia-builder-widget-area .wc_ps_sidebar_container {
width: 100%!important;
margin: 10px 10px 10px 0px!important;
}
}I still can’t see what’s happening on my live site….
Thanks
LyseJuly 28, 2019 at 2:00 am #1122460Hi,
On your live site, I can see your sidebar search almost off the screen to the right, it looks like the 285px is the cause, try changing it to zero.
Please see the screenshot in Private Content area.Best regards,
MikeAugust 3, 2019 at 1:27 am #1124288Hi Mike,
I fixed the CSS code to fix the sidebar widget:
/*position search container below secondary menu */ @media only screen and (max-width: 767px) { .wc_ps_sidebar_container { width: 320px!important; margin: 5px 2px 2px 5px!important; } .phone-info.with_nav span { margin-top: 15px !important; margin-bottom:5px!important; } } @media only screen and (min-width: 989px) { .wc_ps_sidebar_container { width: 350px!important; margin: 10px 10px 10px 285px!important; } }
It works perfectly on the staging and live website on large screen.
On the smaller screen, it works well on the staging site where the phone # gets moved below the search bar, but on the live site, the search bar covers the phone #.Same CSS code is use for both sites.
Any ideas why?
Thanks
Lyse
@media only screen and (min-width: 989px) {
.avia-builder-widget-area .wc_ps_sidebar_container {
width: 100%!important;
margin: 10px 10px 10px 0px!important;
}
}So now
August 4, 2019 at 3:35 am #1124456Hi,
Glad you were able to adjust the css, but when I check your sites the phone # is the same on both sites in mobile.
Please see the screenshot in Private Content area.
Am I understanding correctly?Best regards,
MikeAugust 4, 2019 at 4:41 am #1124467Hi Mike
On the live site I copied the small device CSS in the theme quick style area and it worked. Don’t really understand why but as long as it worked I was Ok with it. My client kept asking to get it fixedThanks
August 4, 2019 at 3:18 pm #1124533Hi,
Glad to hear, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Add second widget in header’ is closed to new replies.