WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Creativix Theme: Placing ads on the frontpage (13 posts)

  1. havingfun
    Member
    Posted 1 year ago #

    I am playing around with Adsense and other ad suppliers. They all talk about copying and pasting the code onto the HTML page. However, I can't figure out where the HTML page is to place ads on the "frontpage" of my Creativix Theme. Can someone show me how to place ads onto the "frontpage" or where the HTML for the "frontpage" is?

    youandthekids.com

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

  3. potentweb
    Member
    Posted 1 year ago #

    There is no HTML page, you have a php pages intermixed with php and html. Some html is already there and others will be generated by php. If you targeting just the frontpage, look for home.php

    Again you can create a child theme or you can risk can just change the main file.

  4. havingfun
    Member
    Posted 1 year ago #

    @potentweb

    Will it stay there permenantly if i were to place it on the main file? If I want the ad placed directly below the slide and another directly below the articles, how do I code it that way with the preset code that I get from the ad supplier?

  5. potentweb
    Member
    Posted 1 year ago #

    It will stay there as long as you ethier create a child theme or do not update your theme. Can't tell you where to put it since I don't know what your theme is nor can I see your code.

  6. havingfun
    Member
    Posted 1 year ago #

    @potentweb

    Theme is Creativix, would you know by chance which php I can try to put the ad code in and in between? I do not see a home.php. This is the list I see:

    404 Template
    (404.php)
    Archives
    (archive.php)
    Comments
    (comments.php)
    Footer
    (footer.php)
    Theme Functions
    (functions.php)
    Header
    (header.php)
    Main Index Template
    (index.php)
    Page Template
    (page.php)
    breadcrumb.php
    wp-pagenavi.php
    Search Results
    (search.php)
    Sidebar
    (sidebar.php)
    single-myportfolio.php
    Single Post
    (single.php)
    style.php
    taxonomy-portfolio.php
    Blog Page Template
    (tpl_blog.php)
    No Sidebar Page Template
    (tpl_page_nosidebar.php)
    Portfolio Page Template
    (tpl_portfolio.php)

  7. potentweb
    Member
    Posted 1 year ago #

    index.php

  8. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    try to add the bottom adsense block before this line in index.php:

    <?php get_footer(); ?>

  9. havingfun
    Member
    Posted 1 year ago #

    @alchymyth

    I placed a "skyscraper" below that line in hopes that it would fill the gap to the right of the articles but it didn't quite work. However, I was able to place a "leaderboard" in between the the two bodies. But it is not centered. The code I inserted is below. Would you guys know the code i can type in to center it on the page? If so, where do I insert it within the code? youandthekids.com

    <script type="text/javascript"><!--
    google_ad_client = "ca-pub-6461945321126128";
    /* leaderboard 728x90 */
    google_ad_slot = "4346136366";
    google_ad_width = 728;
    google_ad_height = 90;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser.]

  10. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    the code i can type in to center it on the page

    one possibility is to wrap the adsense code into a div;

    example:

    <div class="ads">
    ADSENSE CODE HERE
    </div>

    and add in style.css:

    .ads { text-align: center; }

  11. havingfun
    Member
    Posted 1 year ago #

    @alchymyth

    Does it matter where I place the div within the ad code? Beginning or end of the code? Where in style.css do I place the text align code?

  12. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    Does it matter where I place the div within the ad code?

    yes - look at the example; the div wraps around the adcode.

    the location in style.css does not matter, as this is a new css class.

  13. havingfun
    Member
    Posted 1 year ago #

    @alchymyth

    I finally had a chance to give it a shot...and it worked. Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.