Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1399518
    abolian
    Participant

    Hello there,
    I want to show google adsense ads correctly

    i have added the code as following in function.php

    <?php
    
    // =============================================================================
    // FUNCTIONS.PHP
    // -----------------------------------------------------------------------------
    // Overwrite or add your own custom functions to X in this file.
    // =============================================================================
    
    // =============================================================================
    // TABLE OF CONTENTS
    // -----------------------------------------------------------------------------
    //   01. Enqueue Parent Stylesheet
    //   02. Additional Functions
    // =============================================================================
    
    // Enqueue Parent Stylesheet
    // =============================================================================
    
    add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );
    
    // Additional Functions
    // =============================================================================
    
    add_filter('the_content', 'display_author_box', 999999);
    
    function display_author_box ( $content ) {
    
    return is_singular('post') ? $content.do_shortcode('[author title="About the Author"]') : $content;
    
    }
    
    //
    add_action('wp_head', 'custom_scripts');
    
    function custom_scripts() { ?>
    
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script>
      (adsbygoogle = window.adsbygoogle || []).push({
        google_ad_client: "ca-pub-2281927822397133",
        enable_page_level_ads: true
      });
    </script>
    
    <?php }

    but the problem is that on desktop and mobile not shown as expected,
    before disabled the adsense plugin (as google asked to disable it)
    it was autmaticly place the ads on each page 3 ads
    on top and bottom and the middle

    but now, by this code — and reference to this link

    there’s a note that layout of theme should be able to serve the ads and has spaces,

    as you see my “home page” for example

    only at bottom one ads – no other than that,

    Thanks

    #1399723
    Nico
    Moderator

    Hi There,

    Thanks for writing in.

    In this case, to check your setup furthere, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

    #1400088
    abolian
    Participant
    This reply has been marked as private.
    #1400895
    Rad
    Moderator
    This reply has been marked as private.
  • <script> jQuery(function($){ $("#no-reply-1399518 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>