Adding a Banner Ad below the Nav Bar

Community Forums Forums Design Tips and Tricks Adding a Banner Ad below the Nav Bar

This topic is: resolved

This topic contains 9 replies, has 4 voices, and was last updated by  YippyMomma 1 year, 10 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #9752

    YippyMomma
    Participant
    Post count: 89

    I’m using Landscape theme.

    I need to add a banner ad to the home page below the primary nav BUT above the WP-Cycle.

    Can someone advise on how to do this? thanks.

    #9754

    Chris Cree
    Participant
    Post count: 147

    Just edit your home.php file to add your banner code. Open your home.php file in a text editor (NOT Microsoft Word!) and look for this code:

    [html]<div id="homepage">
    <?php if( function_exists(‘wp_cycle’) ) : ?>
    <?php wp_cycle(); ?>
    <?php endif; ?>
    </div>[/html]

    Change it to this
    [html]<div id="homepage">
    <div class="home-banner">
    [BANNER HTML CODE GOES HERE]
    </div>
    <?php if( function_exists(‘wp_cycle’) ) : ?>
    <?php wp_cycle(); ?>
    <?php endif; ?>
    </div>[/html]

    Replace the [BANNER HTML CODE GOES HERE] with the HTML code for your banner.

    Then add any css styling you might need to your style.css file to make the .home-banner area look the way you want it to.


    #10328

    YippyMomma
    Participant
    Post count: 89

    This worked!

    Is it possible to place the banner above (outside) of the wp-cycle frame?

    Thank you for your help!

    #11041

    YippyMomma
    Participant
    Post count: 89

    Trying just to see if anyone knows if it’s possible to place the banner above (outside) of the wp-cycle frame?

    #11120

    John Levandowski
    Participant
    Post count: 8

    You could try adding the following to your theme’s function.php

    [php]add_action( ‘genesis_before_content_sidebar_wrap’, ‘child_before_content_sidebar_wrap’ );
    function child_before_content_sidebar_wrap() {
    ?&gt;INSERT AD CODE HERE&lt;?php
    }[/php]


    #11128

    YippyMomma
    Participant
    Post count: 89

    So remove the home.php code I added then try the function.php code?

    #11202

    John Levandowski
    Participant
    Post count: 8

    Yes, that should work.


    #11257

    cavemedia
    Participant
    Post count: 12

    Hi John,

    I tried your solution and it places the banner inside the inner tag on all pages except the home page. The code needs to be placed after the <div id=nav> and before <div id=inner>

    Suggestions anyone?

    #11546

    YippyMomma
    Participant
    Post count: 89

    Just following up on this to see if anyone else has a thought? Thanks!

    #14529

    YippyMomma
    Participant
    Post count: 89

    My client decided to just leave the banner in the wp-cycle area since it’s displaying properly.

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Adding a Banner Ad below the Nav Bar’ is closed to new replies.