• Resolved TAB

    (@tab)


    Hi folks! I’ve been trying to add adsense for search on my wordpress blog. However, the CSS in my theme seems to be affecting the way the buttons and search bar displays. My site is at ashpics.com/blog

    A screen shot of what happens when I use the adsense for search code can also be found here (where I include a search option for my domain too): techpaedia.com/docs/search.jpg

    Does anyone know which css file I need to edit to fix this? layout.css or spring_flavour.css? Exactly which lines should I edit?

Viewing 7 replies - 1 through 7 (of 7 total)
  • It’s actually going to be the code for the Google Search itself… so you appear to have put it in the sidebar, and the width of it needs to be altered. Check for something like sidebar.php or something like that. (Wherever YOU put the code)

    Thread Starter TAB

    (@tab)

    Thanks ladydelaluna! I have tried this but it turns out that the problem is not with Google’s AdSense Code (+ it’s actually against their policy to edit their code). If I paste exactly the same code in a blank html file, the search graphics display exactly as it should. You can see this in action here: https://ashpics.com/blog/google.html

    The CSS in my theme (BLIX) is somehow over-riding how the buttons appear.

    Okay, let me first say that BLIX is a really difficult theme to mess around with.

    That said, it would take me some time that I don’t have right now to try to hem it out for you, however I did want to say that it’s actually okay to edit the size of the Google search box. What they mean when they say that you can’t edit their code is that you can’t block out the words “Ads by Google” or anything like that in order to make it look like you just have regular links up instead of ads, or that you’re not giving that “credit” to google.

    But as far as ad blocks go, you can go in and change the colors right inside the code, no problem, and if an ad box is say, 2 pixels too wide, you can adjust it without a problem.

    Anyway, I’m not sure what else to tell you other than to try maybe creating a div for the search box itself… and establishing what the dimensions and buttons do inside that div.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    While you’re supposed to use Google’s tool and then not modify the result, Google’s tool itself is simply modifying the size=”XX” bit in the input field when you change the size on their own page. So that is perfectly okay to do, more or less. Same with colors and such.

    Thread Starter TAB

    (@tab)

    Thanks for the advice. ladydelaluna, could you possibly point me to some resources about defining divs for buttons? Do I define those in the spring_flavour.css file?

    It’s not going to be defining the divs for the buttons… it’s going to be creating a new div, just for the google search box code.

    Example:

    #gsearch {
    max-width: 150px;
    (or whatever the width of your sidebar, less your border widths, if any)
    }

    You put that in the .css file.

    Then in your sidebar.php, where your google code is, you put <div id="gsearch"> before the google code, and </div> after it.

    Again, I don’t think this is the best way to do this… and better would be for you to modify the length of the search input box. But try both, and maybe let us know what works?

    Thread Starter TAB

    (@tab)

    Thanks for the help! The problem is finally fixed by having the code in a separate html file and then using ‘iframe’ to place it into the sidebar as so:

    CODE STARTS

    <td style=”padding:0px”><iframe src =”https://www.domain.com/search.html&#8221; width=”200″ frameborder=”0″ scrolling=”no”></iframe></td>

    CODE ENDS

    I’d like to thank Justin from WebbleYou for this idea. WebbleYou also has a widgetized version of the BLIX theme if any of you were interested.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘AdSense for Search and BLIX CSS’ is closed to new replies.