Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
    Posts
  • #314664

    I would like to place a google adsense banner to the right of the logo in the header.
    Tried everything. How do you do this.
    Thanks

    #315027
    #315356

    I was able to place a line of text but the google adsense script did not work. So close – get parse error. Is it because it is asking for text?

    Parse error: syntax error, unexpected ‘Ad’ (T_STRING), expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /home/huss6881/public_html/homerenovations.ca/wp-content/themes/enfold/includes/helper-main-menu.php on line 103

    #315476

    Hi!

    Can you paste the code you are trying to use?

    Regards,
    Josue

    #316034

    Here it is. Many thanks for taking a look.

    <script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
    <!– HR Ad –>
    <ins class=”adsbygoogle”
    style=”display:inline-block;width:728px;height:90px”
    data-ad-client=”ca-pub-6717158804949902″
    data-ad-slot=”1236364606″></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>

    #316303

    Hi!

    Thank you for the info.

    Please add this at the very bottom of functions.php:

    function add_adsense_script(){
    ?>
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!– HR Ad –>
    <div class="header-right">
    <ins class="adsbygoogle"
    style="display:inline-block;width:728px;height:90px"
    data-ad-client="ca-pub-6717158804949902"
    data-ad-slot="1236364606"></ins>
    </div>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    <?php
    }
    add_action('ava_main_header', 'add_adsense_script');

    Use this on Quick CSS or custom.css to adjust the position of the adsense container:

    .header-right {
    position: absolute;
    right: 20%;
    top: -30px;
    }

    Best regards,
    Ismael

    #316609

    Now the site crashed and I cannot fix it. Can you please help? I added the code at the end of the function.php file.Now I get:

    Parse error: syntax error, unexpected ‘?’ in /home/huss6881/public_html/homerenovations.ca/wp-content/themes/enfold/functions.php on line 501

    Line 501 was where I added the code.

    Thanks

    #316666

    Hi,

    Can you please create me an temporary FTP account? post it here as a private reply.

    Regards,
    Josue

    #316715
    This reply has been marked as private.
    #316740
    This reply has been marked as private.
    #316975
    This reply has been marked as private.
    #316992

    Hi Dennis!

    Try using this plugin to store this code.

    Regards,
    Josue

    #318583
    This reply has been marked as private.
    #318587

    Hey!

    I’d suggest disabling it on mobile devices

    @media only screen and (max-width: 767px) {
    .header-right  { display: none; }
    }

    Best regards,
    Josue

    #318637

    Where would I put that?
    Thanks

    #318657

    Hi,

    In Quick CSS.

    Best regards,
    Josue

    #318689

    You guys are top shelf support.

    #318693

    Thanks for the kind words :)

    #320136

    One last issue? The adsense ad is great but you can’t click on it to go to the link?
    Thanks

    #320217

    Hi,

    Can you post the link to your website please?

    Regards,
    Josue

    #320513
    This reply has been marked as private.
    #320701

    Hi!

    Add this:

    .header-right {
        z-index: 100;
    }

    Best regards,
    Josue

    #320730

    Sweet. I really appreciate your support! I’m closing this off.

Viewing 23 posts - 1 through 23 (of 23 total)
  • The topic ‘Adsense Banner Right of Logo’ is closed to new replies.