Support » Themes and Templates » Adding an Image on Homepage (not in a post)

  • Resolved sueheap


    I want to ad an image to the homepage of a template I am working on. Here is the link:

    If you look just above the footer there is whits space, this is where I want a banner type image to go.

    I know this requires php and I have search everywhere for an answer.

    Thanks in advance!!

Viewing 10 replies - 1 through 10 (of 10 total)
  • all details depend on your used theme;

    possibly in index.php, after this line </div><!--.container-->, somewhere before the line with get_footer(); you could add a conditional section with the banner output;


    <?php if( is_home() ) : ?>
    <div class="bottom-banner">whatever image html code</div>
    <?php endif; ?>

    Please excuse my ignorance but I am now to editing templates in such detail..the basic css changes I can do but this is throwing me.
    Here is the code from the main index template. I cant find the </div><!–.container–>..perhaps I am just missing it?

    [code moderated – use the pastebin for any code over the forum limit of 10 lines]

    index.php was only a guess as this is generally the main template for showing the front page.

    you might have a static page set to be on the front, and/or might be using a page template; all of which is virtually impossible to tell from looking at the html code in the browser – particlular if hte theme does not use body_class().

    the general idea would be to locate the template which is used for your home page;

    and then locate the code section just before or after the main content div closes, before the footer starts – this might also be in sidebar.php – might need a bit of searching and trying.

    unfortunately, your theme does seem to be impossible to download without registering.

    I think the main template is also the index..
    here is what I got so far, and the image is not showing:
    css code:

    [please mark any code according to the forum guidelines for posting code]


    [code moderated – use the pastebin for any code over the forum limit of 10 lines – how-to]

    does your theme have a home.php template?

    back to finding which template is used for the front page:

    the posted code is extremely unlikely being used to show the front page.

    yes it does here is the bottom part…would I put that code just above the footer end tag?
    <div class=”grid_7″>
    <?php if ( ! dynamic_sidebar( ‘Address’ ) ) : ?>
    <!–Widgetized Content–>
    <?php endif; ?>

    Put code here?

    <?php get_footer(); ?>

    yes that is the file!!!

    if you look at the page

    its not showing..but it is showing something so thats progress!!

    you are right;
    this is how it shows in the browser:

    <?php if( is_home() ) : ?>
    <div class=&quot;bottom-banner&quot;><img src="images/bottombanner.png" alt="banner" /></div>
    <?php endif; ?>

    i.e. the code must have been html encoded; this happens sometimes when using various text editors.

    what editor are you using to edit the template?

    possibly add the code one </div> lower into the template;
    i.e. here:

    <!--Widgetized Content-->
    <?php endif; ?>
    Put code here? NO
    Put code here
    <?php get_footer(); ?>

    and try to copy the code from here:

    <?php if( is_home() ) : ?>
    <div class="bottom-banner"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/bottombanner.png" alt="banner" /></div>
    <?php endif; ?>

    and add it possibly using the dashboard – appearance – editor to edit the template;

    You are amazing!!! I got it up, just have to tweak a bit but OMG I owe you!!!
    Thank you!!!!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Adding an Image on Homepage (not in a post)’ is closed to new replies.