WordPress.org

Support

Support » Themes and Templates » [Resolved] Creativix Theme: Placing ads on the frontpage

[Resolved] Creativix Theme: Placing ads on the frontpage

  • 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

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator Andrew Nevins

    @anevins

    Forum moderator

    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.

    @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?

    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.

    @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)

    index.php

    Moderator Michael

    @alchymyth

    Forum Moderator

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

    <?php get_footer(); ?>

    @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.]

    Moderator Michael

    @alchymyth

    Forum Moderator

    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; }

    @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?

    Moderator Michael

    @alchymyth

    Forum Moderator

    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.

    @alchymyth

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Resolved] Creativix Theme: Placing ads on the frontpage’ is closed to new replies.