• I am using Ocean Mist 1.2 on https://www.siteguide.us , my blog. I am also displaying a block on the sidebar called Featured Sites. Here, the Text Link Ads service is to be used. However, the Text link ads are programmed to be displayed only on the homepage. This is the function tla_ads().

    Now, in the other pages there will be a blank space under the Featured Sites block. I want to put some other ad code there. Is there any code that I can use to make this happen..
    i.e. something like this:
    if it is homepage use the tla_ads() function else display the alternate ad code

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter wolfsbane

    (@wolfsbane)

    Somebody, Please?

    sounds like you need to add a conditional to your sidebar, something like this:

    <?php if (is_home()) tla_ads(); ?>

    That should call the tla_ads() function if you’re on the home page, and do absolutely nothing if you’re not.

    For an if/else scenario, the PHP syntax would look like this:

    <?php
    if (is_home()) {
        tla_ads();
    } else {
        other_ads();
    }
    />
    Thread Starter wolfsbane

    (@wolfsbane)

    Thank you very much NhytFahl.

    I am really grateful for this

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display only on Homepage’ is closed to new replies.