WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] how do you place an ad at a specific location on the homepage? (13 posts)

  1. havingfun
    Member
    Posted 1 year ago #

    I have been able to place ads on pages/posts/archives. However, how can I place an ad directly below the "Latest Articles" column where there is a lot of dead space in the homepage?

    youandthekids.com

  2. jnhghy
    Member
    Posted 1 year ago #

    Hi, if that's the sidebar then you can try installing a php/html widget and use it in the sidebar(guess this is the most easy and fast solution).
    Regards

  3. havingfun
    Member
    Posted 1 year ago #

    @jnhghy...unfortunately it is not the sidebar. I actually have installed a widget but the sidebar appears everywhere within my site EXCEPT the homepage. That is why I have only one ad on the homepage where I have more throughout the site. I know I more than likely need to place a code somewhere within css but don't know what the code would be (outside of the ad code) and where exactly I would need to place it. Would you or anyone else know?

    Thx in advance...

    youandthekids.com

  4. jnhghy
    Member
    Posted 1 year ago #

    The theme that you are using seems to be custom made by http://www.iwebix.de/ , it's not a theme that all of us have access to so it will be very hard to find somebody that had experiences with this, what I can suggest is to check if in the php files you have something like: home.php or default.php (you can also check index.php) to see if any of these files contain the page generating code if you find it, you can use a pastebin and then it is a little bit easier to get help on that pastebin text.
    Regards

  5. alchymyth
    Forum Moderator
    Posted 1 year ago #

    in index.php;

    add whatever you need after this section (about 5 lines from the end of the file):

    <?php endwhile;?>
                    </ul>
  6. havingfun
    Member
    Posted 1 year ago #

    @alchymyth...thanks for your reponse, however it placed the ad righ on top of the "Latest Articles" list rather than directly below the list. I tried placing the code in a few other places within index.php but close to the area you recommend but also did not work. Any other suggestions?

    youandthekids.com

  7. alchymyth
    Forum Moderator
    Posted 1 year ago #

    the problem is caused by your usage of position:absolute; on the .latest-posts;

    try to pull the ad code to before the </ul>;

    and possibly wrap the ad code into a span or div for more formatting options.

    alternatively:
    wrap the featured posts into a div; and remove the absolute positioning from .latest-posts;

    in index.php, add the opening div here:

    <div id="column-top">
            </div>
    
            <div id="column-content">
    
    		<div class="feature-wrapper"><!-- wrapper div for featured posts -->
    
    		<?php
    
    		global $post;

    and close it here:

    <?php endforeach; ?>
    		</div><!-- .feature-wrapper -->
    
            <div class="latest-posts">
                    <h2>Latest Articles</h2>

    and style it with:

    .feature-wrapper {
    float: left;
    width: 663px;
    }

    I would still suggest that you wrap the ad code into a div for formatting reasons.

  8. havingfun
    Member
    Posted 1 year ago #

    @alchymyth...sorry to ask this but how do you "wrap the ad code into a div" since you ultimately suggest it for formatting reasons? Unfortunately, I am not a coder and am not familiar with it but can try with direction.

  9. alchymyth
    Forum Moderator
    Posted 1 year ago #

    example:

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

    which you could style with:

    .ads { ... }

  10. havingfun
    Member
    Posted 1 year ago #

    @alchymyth...thank you so much for your help and your patience!

  11. havingfun
    Member
    Posted 1 year ago #

    @alchymyth...actually one more thing. Can you help me with the code and where to place it on how to seperate the two ads I had placed on the home page below recent articles? I would like to place a little space in between the two ads and move the top ad a little lower from the recent articles list too. Right now the two ads are stuck to eachother and the top ad seems to close to the list of recent articles.

    youandthekids.com

  12. alchymyth
    Forum Moderator
    Posted 1 year ago #

    place a little space in between the two ads and move the top ad a little lower from the recent articles list

    that is where the 'wrapping in a div' comes in;

    you could do this directly in the divs with inline styles;
    example:

    <div style="margin-top:20px;">
    ADSENSE CODE 1
    </div>
    <div style="margin-top:20px;">
    ADSENSE CODE 2
    </div>

    http://www.w3schools.com/css/css_margin.asp

  13. havingfun
    Member
    Posted 1 year ago #

    @alchymyth...well done! perfect! and thx for the css link too. It is definately something I will have to try to learn myself (but I must say is very intimidating).

Topic Closed

This topic has been closed to new replies.

About this Topic