• Hi,

    At header in logo section, there is much unused space – on the right.

    Is there any way to put banner in that place?

    I’ve found some tutorials for wordpress:

    Maybe there are easier steps to do that?

    Best Regards,
    Krystian

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey there Krystian,

    How are you doing today?

    That really depends on what exactly are you looking to do, if you want to place the banner next to your logo in the header you’ll have to make changes to header.php. For this I’d strongly suggest creating a child theme and making a copy of header.php there so you can avoid losing changes once you update the theme.

    If you want to do this please and need more assistance, please let me know ??

    Cheers,
    Bojan

    Thread Starter Joseph28

    (@joseph28)

    Hello,

    Thanks for response ?? I’m fine – thanks ??

    What I want to accomplish is some div right from logo, where I can put some AdSense ad code, sponsor banner or something like that.

    I don’t need widget that could be managed from “widgets” in WordPress Admin Panel. It could be div manually managed.

    The one thing I know – it should be added somewhere in header.php ??

    The problem is – I’m not too good in PHP and WordPress :-/

    I’ve found something like that, it will be good? Link: https://kb.oboxthemes.com/articles/how-to-insert-a-banner-ad-to-the-right-of-your-logo/

    Hey again Joseph28,

    This is exactly what you need to do. Simply add the following code right below the logo end in your header.php which is located in the root folder of your theme, check screenshot https://screencast.com/t/4fLId6xTgo.

    <div class="header_ad">
    Add your ad here.
    </div>

    As I mentioned above I’d advise on using child theme so you can avoid losing changes once you update the theme.

    After that we can use header_ad class which we added to this div to position it in the header as mentioned in the post you linked so for start you’d want to add the following CSS:

    .header_ad {
      float: right;
    }

    This will push it to the right side of the header, depending on the size of the image we’ll probably have to add some margins as well, I can help you with that also if you could post link to your site once you’re done ??

    Hope this helps ??

    Cheers,
    Bojan

    Thread Starter Joseph28

    (@joseph28)

    Thank You for response.

    Something goes wrong ??

    Test code from header.php:

    <div class="header_ad">
       <a href="https://www.obox-themes.com"><img src="https://www.mytestsandbox.com/images/bannerTestPage.jpg" alt="Obox" /></a>
     </div>

    Added float to style.css.

    Final effect: nothing right to logo – still white, blank space. No banner, no clickable href. I dont know why – header.php looks like Your ??

    Hey again Joseph28,

    Sorry to hear the code is not working, I’ve tested this on my end using the same code with href and image and this was the result https://screencast.com/t/bxGm3tn61Jb2.

    The image source looks good since I was able to see the image so I’m not sure what could be the problem.

    Can you please paste your header.php using https://pastebin.com/ and paste the link here so I can check it out, and also add the code and post link to your site so I can take a look.

    Best regards,
    Bojan

    Thread Starter Joseph28

    (@joseph28)

    Hello ??

    I’ve found cause of my problem. I’m using W3 Total Cache plugin which cached site before changes in code. Page was displayed from cache, without changes. I had to clear cache in plugin options.

    There was only one thing I had to do. Banner from my previous post was forced to display below logo of my site (right to it, but below). I’ve added clear: both; to header_ad in style.css. Now – banner is next to logo, just like I’ve wanted ?? Great!

    Heh – helpdesk here is amazing. I don’t know how to thank You (and for patience).

    Thanks once again – I appreciate that.

    Best Regards,
    Krystian

    Hey Krystian,

    Glad you managed to figure that out ??

    WordPress community is awesome! Have a great day!

    Cheers,
    Bojan

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to put banner, right to logo?’ is closed to new replies.