WordPress.org

Forums

How to display different content on different pages with one widget (4 posts)

  1. netviper
    Member
    Posted 3 years ago #

    Hi All,

    I am building a site and the client had asked for a widget to download product brochures. Simple enough. However, he wants on the brochure of the product to show up that matches the page you are on.

    I am using the same sidebar for 10 products, so I don't want to make 10 different sidebars. I just want it to say "if page = gym shoes" then display link to gym shoes brochure.

    Any help on how to do this?

    Thanks,

  2. esmi
    Forum Moderator
    Posted 3 years ago #

  3. netviper
    Member
    Posted 3 years ago #

    I don't think this will will for me.

    Thanks for the Suggestion.

    Anyone else?

  4. netviper
    Member
    Posted 3 years ago #

    Figured it out.
    First used the PHP widget -- then placed.

    <?php
    if (is_page('aramis')) {
    echo '<h3 class="widgettitle">Brochure Downloads</h3>';
    echo 'Click Here to Download the Aramis Brouchure';
    }
    if (is_page('pontos')) {
    echo '<h3 class="widgettitle">Brochure Downloads</h3>';
    echo 'Click Here to Download the Pontos Brouchure';
    }
    if (is_page('argus')) {
    echo '<h3 class="widgettitle">Brochure Downloads</h3>';
    echo 'Click Here to Download the Argus Brouchure';
    }
    if (is_page('tritop')) {
    echo '<h3 class="widgettitle">Brochure Downloads</h3>';
    echo 'Click Here to Download the Tritop Brouchure';
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic