need help with php-query for image-swap
-
hi,
for my little wordpress-theme i need a little php-script. i am not a programmer and very new to wp so the php-syntax is killing my idea.
i have a name convention for my pictures. they are stored in the image-folder in my template-directory and named like this:
img-"the_title".jpg
the_title
is the wordpress template tag.
example: img-contact.jpgnow i need a query that swaps my pictures automatically when i click through my page.
i have a script fragment of another page but it doesn’t work with wordpress:
<img src="images/img-<? if (file_exists("images/img-".$plink.".jpg")) { echo $plink.".jpg"; } else { echo "img-default.jpg"; } ?>" width=960 height=204 alt="" border=0 hspace=0 vspace=0>
i need a way to exchange the
$plink
to the wordpress template tag/functionthe_title
but i have no clue how to get this to work =) i get tons of errors …i hope someone can help me with this (… and understand my bad english =)
thanks,
le huf
- The topic ‘need help with php-query for image-swap’ is closed to new replies.