Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Posts
    101
    Plugin Contributions
    0

    Default Using if on index page

    I have am image I only want to display in the home page. I want to use an "if" statement to do this. What would be the correct syntax to use to accomplish this?

    Here is the code string that I want only on the home (index) page.
    <tr>
    <td width="500"><img src="<?php echo DIR_WS_TEMPLATE_IMAGES; ?>az_info_image.jpg"></td></td>
    </tr>

    Thanks-
    -Jeff
    ----------------------------

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Using if on index page

    Better would be to put your image in your template's images folder and then use the following

    PHP Code:
    <?php
    if ($this_is_homepage) {
      
    zen_image($template->get_template_dir('az_info_image.jpg'DIR_WS_TEMPLATE$current_page_base,'images'). '/' 'az_info_image.jpg''image alt text''image width''image height');
    }
    ?>
    You don't need the table stuff unless you're trying to give your HTML a 1990s retro vibe.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    May 2004
    Posts
    101
    Plugin Contributions
    0

    Default Re: Using if on index page

    "You don't need the table stuff unless you're trying to give your HTML a 1990s retro vibe."

    LOL - the template I am using contains some tables. I know, how old school. :)

    Thanks so much.
    -Jeff
    ----------------------------

  4. #4
    Join Date
    May 2004
    Posts
    101
    Plugin Contributions
    0

    Default Re: Using if on index page

    This does not seem to work, any other suggestions?
    -Jeff
    ----------------------------

 

 

Similar Threads

  1. Why strange /index/xxx urls showing my index page
    By creamcrackers in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 27 Mar 2012, 03:23 AM
  2. An Announcement box on index page, and only on Index page
    By nigelt74 in forum General Questions
    Replies: 4
    Last Post: 25 Mar 2009, 01:41 AM
  3. Change Logo for Index Page Using CSS?
    By Mountain Mama in forum Templates, Stylesheets, Page Layout
    Replies: 14
    Last Post: 12 Dec 2008, 03:47 AM
  4. Blank Index Page/Apache Errors - Optimize MYSQL Index
    By fr33k in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 23 Oct 2008, 10:58 PM
  5. Replies: 2
    Last Post: 17 Jul 2007, 04:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg