WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
If There is a Description show it, if not show file name (1 post)

  1. Chris
    Member
    Posted 2 years ago #

    So I am trying to get a little php to work but am just terrible when it comes to php. I would like to show the image description if there is one and if there isn't I would like the image filename to show. Here is what I have but I know it is wrong:

    <?php
    			$f = $image->filename;
    			$d = $image->description;
    			if ($d) echo "$d";
    			else { echo "$f" ; } ?>

    Anyone know what I am doing wrong? Thanks!

    http://wordpress.org/extend/plugins/nextgen-gallery/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic