Styling header widget

  • Anonymous

    #1909

    Hy,

    where can I style header widget? Basically I want to align widget to top right corner (default is left) and add some space from top border to fit adsense banner over header image. Trying to find that in style.css but unable to find. Current state is without header widget. Of course I will reedit header image after putting banner over it.

    http://www.kkciglenica.com/kkciglenica

    Thnks in advance 4 any help.

    Anonymous

    #17790

    I’m not quite sure I understand what you are trying to do. Are you wanting to move the social sharing icons?

    Mod

    Anonymous

    #17792

    Thnx Ken.This is exactly what I was looking for.

    Anonymous

    #17793

    This is what I was trying to do…

    http://www.kkciglenica.com/kkciglenica

    Added a div id tag in header.php (just before this:<?php /* Header widget area */) with adsense code in it, and styling it with css (float: right)

    Now, the problem is that I changed the graphene header.php, so after upgrade it will probably go to hell ;). I have to put it in child theme somehow…

    thnx for help, without this forum I do not think I could make it!

    Anonymous

    #17794

    For this, you could use an action hook in your child theme functions.php file.

    If you look at your header.php in your original graphene directory… You will notice different <php do action(); ?>‘s scattered throughout. Create a function in your child functions.php file and add something like this…

    For this, I named a function josh_headercloud and a div id headercloud.

    Notice at the bottom the add action. This is telling the function to first display the do action( 'graphene_header' ) and then directly afterwards it will display the do action ( 'josh_headercloud' ).

    Lastly, use your child theme CSS positioning.. create an element, in my case #headercloud (matching the div id), and assign it properties as needed for positioning.

    This keeps everything in your child theme and there is no need to alter core files.

    Good Luck 🙂

    Anonymous

    #17795

    What I’m doing wrong:

    1.function adsense-header(){

    2. ?>

    3. <div id=”adsense-head”>

    4. <script type=”text/javascript”><!–

    5.google_ad_client = “ca-pub-xxxxxxxxxxxx”;

    6./* ciglenica1_468x60 */

    7.google_ad_slot = “xxxxxxxxx”;

    8.google_ad_width = 468;

    9.google_ad_height = 60;

    10.//–>

    11.</script>

    12.<script type=”text/javascript”

    13.src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>

    14.</script>

    15. </div>

    16. <?php

    17.}

    18.add_action( ‘graphene_header’, ‘adsense-header’ );

    I’m getting syntax error in line 17 , Really NOT much of an PHP experct! Please help.

    Anonymous

    #17796

    Lastly, I menage to insert adsense and style it with action hook, but why is my width after theme update gone so wide (to right). So adsense is showing on the far right corner outside of the main content width?

    http://kkciglenica.com/kkciglenica

    This is happening only when action hook widget is activated. Otherwise it’s OK.

    Anonymous

    #17797

    Did it finaly: in chil page function.php insert this:

    <?php

    function adsense_banner() {

    ?>

    <div id=”adsense-head”>

    Adsense code!

    </div>

    <?php

    }

    add_action( ‘graphene_header’, ‘adsense_banner’ ); ?>

    and style it with css.

    I didn’t close tag (?>).

    But couldn’t make it with theme action hook widget…

    At least I did it myself.;)

    Anonymous

    #17798

    Good for you. It’s amazing what a missing question mark can do in your code 😉

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

Do NOT follow this link or you will be banned from the site!