adsence search button pushed down

Posted in: Newsmag
Post count: 226

Hi guys, I am traing to implement Google search bar on a page with visual composer but the “search” button is pushed down no matter how i implement it. how can I make it be at the right?

Post count: 226

here is the screenshot

Also I would like to get rid of the little grey lines if possible
Thanks again!

Post count: 9544

You would need to add CSS for the class being added by Google. Nothing to do with the theme.

You should look at the docs on styling the Google search elements. I just had to do this on our business site. Bit of a pain. Basically you have to create a class which sets the width of the search box, and then add that class to the box element for the search box.

Post count: 226

It think this is because of the responsive setting of visual composer, naturally Google search has the button at the right and i also have the search box set to be short but VS is enlarging it to fit the whole column. Not sure i understand what you propose, can you explain in more detail?

Thanks a lot!

Post count: 226

also do you know how to get rid of the gray lines that separate the columns?

Post count: 9544

1) you would need to look at rendered page, find the class for the box, then add to custom CSS with the !important tag. On our business site we were not using WP, but using Bootstrap 2, and so ran into same issue with the default form CSS. Took a bunch of tries to figure out how to get it to be short, and search button at right. If I had the trick for this theme handy, would totally share it.

2) I think you can change the lines for the theme from grey to white to “remove” them as the simplest fix.

Post count: 9544

I think what we ended up doing for the search box was setting a fixed width like 200px or something.

Post count: 226

Thanks a lot, i am trying to do it, Looking forward to suggestions from the theme guys as well. maybe there is an easier way….

Post count: 9544

Well, since it’s not part of the theme, and the CSS classes are part of Google’s code; the only way to “over ride” that is by putting some kind of CSS in the custom CSS box. Kind of up to you to solve, but “official” support might offer to write code for you.

Post count: 226

I identified the cclass as wpb_wrapper , I can manage to add a custom css for i am not sure what to add so the button is not pushed down….:( any ideas?

Thanks again for the help!

Post count: 9544

In our case, once we got rid of the width of the box, the button moved up to right. We might have removed the line break if one was added; been a couple of months since I suffered through that 🙂

I also gave up on the nice ‘overlay’ search results option and ended up with the “normal page of results with our logo” option. Trying to style the overlay results was almost impossible to sort out and Google’s docs are somewhat worthless.

Keep messing with it…
do you have link to a post/page where you’re using that? I might be able to take a peek once I deal with some client stuff.

this is the code we ended up with if curious;


<form class="form" action="https://www.google.com/cse" id="cse-search-box">
<fieldset>
<input type="hidden" name="cx" value="XXXXXXXX"/>
<input type="text" name="q" placeholder=" Search My Site Name Here" style="height:1.8em;width:10.0em;padding:0;margin:0;"/>
<button type="submit" name="sa" class="btn btn-primary disabled" value="Search">Search</button>
</fieldset>
</form>

as you can see, I think we gave up and finally just decided to hack the code by doing bad practice of putting the style inline. We’re using bootstrap 2 on our main business site, hence the existing classes for buttons.

Post count: 226

Thank again! I am still trying to do it. this is my site i case you have time to take a look:

http://bnearme.com/fast-food-near-me/

I will keep playing with it in the mean while

Post count: 9544

You know. I think I get the stupid prize (face palm!).

For some reason I thought you were trying to implement Google’s custom search for YOUR site, and not the adsense affiliate search box.

Doh. Two totally different things entirely, even though your title for support CLEARLY says that.

Wow, that’s twice this week I was clueless on the reply. Definitely time for a vacation.

Sorry about that …. I have no clue how to style the affiliate/adsense box, as that loads from javascript provided by Google. Only way to do that with your own CSS is to view the page source, grab the rendered code and then hack that, and then place that on your page in place of their javascript.

Or, do what you were trying to do with the CSS you’ve found. Hitting F12 in Chrome and then looking at that code and styles might help you track that stupid box code down too.

Sorry I have my dunce cap on. I am really multi-tasking and popping in here while doing two things at once on two big 24-inch Apple LED Cinema displays.

Anyway… hope I at least stimulated the neurons, even if my solutions were completely unrelated to what you’re doing, other than being goofy Googleverse CSS.

Post count: 226

hi, thanks again! No need to be upset. You helped me anyways. I hope the theme support give me a hand on this one because adsence code is ok and can’t be modified (becuase of TOS) , in my other sites work just fine. I am pretty sure this is happening because of visual composer.

anyways i will keep researching…..

S

Post count: 6600

Hi,

Please try this custom css: http://screencast.com/t/5k5sGpxn7VO

@media (min-width: 1024px) {
#cse-search-box input[type=text] {
width: 89%;
max-width: 89%;
}
}

@media (min-width: 768px) and (max-width: 1023px) {
#cse-search-box input[type=text] {
width: 85%;
max-width: 85%;
}
}
@media (max-width: 767px) {
#cse-search-box input[type=text] {
width: 80%;
max-width: 80%;
}
}

@media (max-width: 500px) {
#cse-search-box input[type=text] {
width: 76%;
max-width: 76%;
}
}

#cse-search-box input[type=text] {
border: 0px solid rgb(126, 157, 185) !important;
}

Please let me know how it works for you!

Thanks

  • This reply was modified 11 years by Lucian.
Post count: 226

hi Lucian, thanks a lot, that solved the issue of the button position, but there is two other issues

1) the border of the rectangle is lost and is hard to tell there is there a search , how can i make it visible again?

2) how do i get rid of this grey lines:
http://bnearme.com/wp-content/uploads/2014/12/capture-2.jpg

Thanks again!!!
s

Post count: 6600

Hi,

Please use this css: http://screencast.com/t/HSJOZsL8mbH

.page-id-30 .td-container-border .td-pb-span6, .page-id-30 .td-container-border .td-pb-span8, .page-id-30 .td-container-border .td-pb-span3, .page-id-30 .td-container-border .td-pb-span2 {
border-left: 1px solid #ffffff;
}

.page-id-30 #cse-search-box input[type=text] {
border: 1px solid rgb(126, 157, 185) !important;
}

Hope this helps!

Thanks

Post count: 226

Hi lucian! That did it, This is the reason I bought your theme, Your support absolutely kick ass!

Thanks again!!

S

Post count: 226

one last questions. will this apllay to newspaper too? in case not, what i will need there?

Thanks!

Post count: 6600

Hi,

Unfortunately not as with newspaper there are other css classes and it also depends on the page you chose to add the google custom search.
Fell free to open a new topic there and let me know about this topic also and I will provide a solution in that case also.

Thanks

Post count: 226

hi there I added a new post today

http://bnearme.com/asian-restaurants-near-me/

and i see changes do not aplay to it, the other one is still ok, what can we do?

Thanks again!

Post count: 9544

Be sure to clear all your caching and reload page if it “suddenly” stopped working.

Also note the CSS provided looks like it applied to a post number specifically and not all pages/posts, .page-id-30 — so you obviously need to look at that for the actual page/post ID you just published. If your post you just published had ID of 76, then I don’t think the page id 30 would work.

Unless I’m mistaken on that 🙂

Post count: 226

yes I am wandering how can a set it up to work for “all pages”, ideas?

Thanks!

Post count: 1291

Hi,

Your new page has a different id – http://screencast.com/t/eLJonZ4J11
To make the css apply to all pages replace .page-id-30 with .page

Thank you, Emil G.

Post count: 226

Perfect! Thanks again for all your efforts!

Have a good day!

Viewing 25 posts - 1 through 25 (of 25 total)
The forum ‘Newsmag’ is closed to new topics and replies.