• Resolved falconayr

    (@falconayr)


    Hi there,

    I would like to insert and advert at the end of every post (after the writing) and I am using a plugin to do it.

    Could somebody let me know which file I am looking for (file that shows the posts) and if possible where to place the code that the plugin (AdRotator) requires me to add.

    the code is a simple php code:

    < ?<b>php</b> echo getad('bannerad') ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • Samuel B

    (@samboll)

    theme’s index.php shows posts on front page
    theme’s single.php shows posts in the single post view
    you want to add your code right after the_content() call in one or both of these files

    Thread Starter falconayr

    (@falconayr)

    Thank you.

    My theeme single.php does not seem to have the_content() call.

    It has:

    <div id="wrapper">
        <?php include(TEMPLATEPATH . "/menu.php"); ?>
        <?php include(TEMPLATEPATH . "/banner.php"); ?>
        <div class="content">
            <?php if($options['bb_sidebar_layout'] == 'l' or $options['bb_sidebar_layout'] == 'll' or $options['bb_sidebar_layout'] == 'lr') { ?>
                <?php include(TEMPLATEPATH . "/leftsidepanel.php"); ?>
            <?php } ?>
            <div class="container">
                <ul class="posts">
                    <?php if (have_posts()) : ?>
                    <?php while (have_posts()) : the_post(); ?>
                    <li>
                        <?php include (TEMPLATEPATH . "/item.php"); ?>
                        <?php if (function_exists('wp_list_comments')): ?>
                            <?php comments_template('', true); ?>
                        <?php endif; ?>
                    </li>
                    <?php endwhile; ?>
                    <?php endif; ?>
                </ul>
            </div>
            <?php if($options['bb_sidebar_layout'] == 'r' or $options['bb_sidebar_layout'] == 'rr' or $options['bb_sidebar_layout'] == 'lr') { ?>
                <?php include(TEMPLATEPATH . "/rightsidepanel.php"); ?>
            <?php } ?>
            <div class="clear"></div>
        </div>
        <?php get_footer(); ?>
    </div>

    I take my code would go in the middle of of this bit:

    <ul class="posts">
                    <?php if (have_posts()) : ?>
                    <?php while (have_posts()) : the_post(); ?>
                    <li>
                        <?php include (TEMPLATEPATH . "/item.php"); ?>
                        <?php if (function_exists('wp_list_comments')): ?>
                            <?php comments_template('', true); ?>
                        <?php endif; ?>
                    </li>
                    <?php endwhile; ?>
                    <?php endif; ?>
                </ul>

    Between these two bits of code:

    <?php include (TEMPLATEPATH . "/item.php"); ?>
                        <?php if (function_exists('wp_list_comments')): ?>

    sounds right….does item.php have the_content call? Since it item.php appears to be bringing in your posts (You may be able to ad your code to the bottom of item.php too, if that’s more appropriate)

    Thread Starter falconayr

    (@falconayr)

    Hi there,

    Bang on thank you. I found the content call in item.php and have got it working.

    Thanks a million

    Sure thing!

    Samuel B

    (@samboll)

    wow- who would have guessed item.php?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Post File’ is closed to new replies.