Forums

How to add a banner-ad widget to all posts (10 posts)

  1. Chloe2
    Member
    Posted 2 years ago #

    Hello,

    I've developed a website using the Atahualpa theme. I've figured out how to add my banner ad to the header and the sidebar but I can't find any information on how to add oone to the posts. (No one in the Bytes For All Forum knows how to do this. They sent me to wordpress.org.) The rotating ad is 200x250 and I'd like to put it about 1/3 of the way down the screen, aligned right on every post.

    Your help with this is very much appreciated.

    Chloe

  2. MichaelH
    Volunteer
    Posted 2 years ago #

  3. Chloe2
    Member
    Posted 2 years ago #

    Thanks. Yes I did look at that posting earlier. This is the Loop code in the Atahualpa theme:

    **************************************************
    <?php /* For SINGLE post pages if activated at ATO -> Next/Previous Navigation: */
    bfa_next_previous_post_links('Top'); ?>

    <?php /* Post Container starts here */

    if ( function_exists('post_class') ) { ?>
    <div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>">

    <?php } else { ?>
    <div class="<?php echo ( is_page() ? 'page ' : '' ) . $odd_or_even . ' post" id="post-'; the_ID(); ?>">

    <?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>

    <?php bfa_post_headline('<div class="post-headline">','</div>'); ?>

    <?php bfa_post_byline('<div class="post-byline">','</div>'); ?>

    <?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>

    <?php bfa_post_pagination('<p class="post-pagination">'.__('Pages:','atahualpa').'','</p>'); ?>

    <?php bfa_post_footer('<div class="post-footer">','</div>'); ?>

    </div><!-- / Post -->

    *********************************************************
    This is the code I want to add:

    <?php bfa_widget_area('name=post_ad area&cells=1&align_1=4&after_widget=</div>'); ?>

    But I don't know where to add it so the ad views 1/3 down the screen in the post.

    Thanks for your help,
    Chloe

  4. MichaelH
    Volunteer
    Posted 2 years ago #

    Not sure maybe in the bfa_post_bodycopy function.
    I've added the http://wordpress.org/tags/atahualpa tag so someone might find this thread.

    When search on google for a solution someone noted they had success with this plugin and your theme.

    http://wordpress.org/extend/plugins/advertising-manager/

  5. Chloe2
    Member
    Posted 2 years ago #

    Thanks for your help Michael. I tried the advertising manager plug-in and it keeps giving me a symtax error. I'm looking into it further.

  6. Digital Raindrops
    Member
    Posted 2 years ago #

    Check out the WP-Include plugin.

    David

  7. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Last time I needed to do this, I found AdServe easy to use and quite light.

  8. Chloe2
    Member
    Posted 2 years ago #

    Thanks Esmi. I'll try that.

  9. Chloe2
    Member
    Posted 2 years ago #

    Hi David,
    I checked out WP-include (after getting no where with advertising manager and AdServe). WP-include looks promising but I need my ad to be automatically embedded in each post on my website.

    WP-include provides the following code to be added in functions.php but this just allows me to manually insert the ad in each page or post.

    **********************************************************
    function include_file($atts) {
    //check the input and override the default filepath NULL
    //if filepath was specified
    extract(shortcode_atts(array('filepath' => 'NULL'), $atts));
    //check if the filepath was specified and if the file exists
    if ($filepath!='NULL' && file_exists(TEMPLATEPATH.$filepath)){
    //turno on output buffering to capture script output
    ob_start();
    //include the specified file
    include(TEMPLATEPATH.$filepath);
    //assign the file output to $content variable and clean buffer
    $content = ob_get_clean();
    //return the $content
    //return is important for the output to appear at the correct position
    //in the content
    return $content;
    }
    }
    //register the Shortcode handler
    add_shortcode('include', 'include_file');

    *******************************************************

    I need to find a way to automatically embed the ad in every post. Any ideas or suggestions are very welcomed.

    Thanks

  10. ronakshah
    Member
    Posted 2 years ago #

    There is something called as RAW html plugin which will post your banner for you if you post the code in the html area.

    However, this is done manually.

    Try using wp-banner plugin as well.

    Ronak

Topic Closed

This topic has been closed to new replies.

About this Topic