Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #93167

    anilanvesh
    Participant

    Hello X Team,

    I’m using theme X Renew stack. I want to place Google AdSense code just below the post headline and end of the post. What is the file I have to place the code kindly guide me.

    #93173

    Kosher K
    Member

    Hi There,

    You then set set-up a child theme for that,

    Please follow these guides
    -> http://theme.co/x/member/kb/how-to-setup-child-themes/
    -> http://theme.co/x/member/kb/customization-best-practices/

    Copy these files to your child theme and add our adsense code in there.

    x/framework/views/renew/_content-post-footer.php
    
    x/framework/views/renew/_content-post-header.php

    Hope that helps.

    Cheers

    #93214

    anilanvesh
    Participant

    I’m using Renew child theme. Where should I copy those files under views, Global or Renew?

    #93358

    Mrinal
    Member

    Hi Anil,

    Place the copied file in this path: x-child-renew/framework/views/renew/_content-post-header.php & x-child-renew/framework/views/renew/_content-post-footer.php

    #102709

    anilanvesh
    Participant

    Dear Support Team,
    The files you recommended are wrong for my objective. My goal is to place adsense codes in blog posts. One ad should be just below the post heading, meta data and other one after the post before tags and comments not in the footer area.

    #102737

    Mrinal
    Member

    Hi Anil,

    As advised in previous replies, you need to place codes into those files.

    The header file controls the Post Tile & Meta & the Footer file controls the Tags & Comment Template placement. So if you place your Adsense codes into those file they’ll be placed in your desired area.

    #102742

    anilanvesh
    Participant

    Dear Support Team,
    I need ads in posts only not in pages or portfolios. When I placed the code in those files. Im seeing ads in home page post excerpts only. Kindly guide me exactly in which in which area i mean in the code I have to place the ad codes.

    #102768

    Mrinal
    Member

    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.

    #102774

    anilanvesh
    Participant

    Dear Team,
    The header part is ok but Im confused where to place code in _content-post-footer.php Below is the code in that file. Kindly guide me where to place the code

    <?php
    
    // =============================================================================
    // VIEWS/RENEW/_CONTENT-POST-FOOTER.PHP
    // -----------------------------------------------------------------------------
    // Standard <footer> output for various posts.
    // =============================================================================
    
    ?>
    
    <?php if ( has_tag() ) : ?>
      <footer class="entry-footer cf">
        <?php echo get_the_tag_list( '<p><i class="x-icon-tags"></i> Tags: ', ', ', '</p>' ); ?>
      </footer>
    <?php endif; ?>
    #102778

    Mrinal
    Member

    Before this line: <?php echo get_the_tag_list( '<p><i class="x-icon-tags"></i> Tags: ', ', ', '</p>' ); ?>

    As I said in previous reply, you can share your site url here so I can provide code to you to hide them from arhive/blog/homepage

    #129126

    anilanvesh
    Participant
    This reply has been marked as private.
    #129366

    Kosher K
    Member

    Hi There,

    Please copy these following files to your child theme,

    x/framework/views/renew/_content-post-footer.php
    x/framework/views/renew/_content-post-header.php

    it should be inside

    x-child-renew/framework/views/renew/_content-post-footer.php
    x-child-renew/framework/views/renew/_content-post-header.php

    You can add it anywhere you want.

    e.g.

    <?php
    
    // =============================================================================
    // VIEWS/RENEW/_CONTENT-POST-FOOTER.PHP
    // -----------------------------------------------------------------------------
    // Standard <footer> output for various posts.
    // =============================================================================
    
    ?>
    <script type="text/javascript"><!--
    google_ad_client = "pub-12412412412a4gfaw";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "text_image";
    google_ad_channel = "";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "FFFFFF";
    google_color_text = "FFFFFF";
    google_color_url = "FFFFFF";
    google_ui_features = "rc:0";
    //-->
    </script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    <?php if ( has_tag() ) : ?>
      <footer class="entry-footer cf">
        <?php echo get_the_tag_list( '<p><i class="x-icon-tags"></i> Tags: ', ', ', '</p>' ); ?>
      </footer>
    <?php endif; ?>

    or

    <?php
    
    // =============================================================================
    // VIEWS/RENEW/_CONTENT-POST-FOOTER.PHP
    // -----------------------------------------------------------------------------
    // Standard <footer> output for various posts.
    // =============================================================================
    
    ?>
    <?php if ( has_tag() ) : ?>
      <footer class="entry-footer cf">
        <?php echo get_the_tag_list( '<p><i class="x-icon-tags"></i> Tags: ', ', ', '</p>' ); ?>
      </footer>
    <?php endif; ?>
    <script type="text/javascript"><!--
    google_ad_client = "pub-12412412412a4gfaw";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "text_image";
    google_ad_channel = "";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "FFFFFF";
    google_color_text = "FFFFFF";
    google_color_url = "FFFFFF";
    google_ui_features = "rc:0";
    //-->
    </script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

    Hope that helps