WordPress Theme manipulation – Remove Widget Background

So I know this is a bit out of ordinary for me to ask a question like this, but for some reason I am just really having an issue grasping this.

My Problem:
I have a responsive layout theme for word press, its clean its pretty. When implementing Google ad-sense into a text/html widget on the right bar it over runs the widget size and over hangs on the right hand side.

Read More

My Question:
What will be the best method for getting my ad to look more uniform. Is there a way to select a single widget css? Is there a way to put a div inside that widget and select the parent css from that div? Should I go in and hard code it into the theme?

Additional:
The theme I am using has a built in child theme option which I have chosen to use. When I place the code into the child themes function.php it breaks the theme and displays what I enter as plain text to the screen. Adding opening and close php tags did not seem to fix this issue.

Related posts

Leave a Reply

2 comments

  1. Well it appears once again I asked a question before fully digging my brain into this. Hopefully this will become something useful for someone else.

    FIX:
    It appears that wordpress assigns a unique ID to every widget that is created.

    Created New Text Widget
    Wordpress Assigns: text-1
    

    I can now go into css and manipulate this widget directly.

    #text-1 {
    //do somthing
    }
    
  2. It’s always best to avoid hardcoding WP themes as when they get updated your modifications might vanish.
    Glad to see you figured it out, I was going to say that you CAN add a div inside a widget and give it a name, which might still be be better than use the WP assigned layer name, as that might change if you were to delete or re-add the widget.