Support » Fixing WordPress » Simple question about – is_page()

  • Hello all!
    I’m attempting to display an image on my page depending on what page is shown. I currently have the following code:

    http://pastebin.com/b79Uugay

    For some reason, it is completely refusing to work.
    Within Dreamweaver, if I take out all the img scr code, it displays no errors.

    Any suggestions? Very new to WordPress coding.
    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    have you checked the html code in teh browser, to see if the img tags are shown?

    where are the images located/saved?

    possibly try to use absolute image paths.

    1st question : where are located your image ?

    I think this would be more correct depending where is your image but normally on your template folder :

    if(is_page('About'))
            {
                    <img src="<?php bloginfo('template_url'); ?>/image1.jpg">
            }

    2nd question: do you have a link to see the pb

    Managed to fix it by placing my img src inside an echo statement:

    if(is_page('About'))
            {
                    echo '<img src="image1.jpg">';
            }
    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Good work Zillion.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Simple question about – is_page()’ is closed to new replies.