Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author shauno

    (@shauno)

    $out = '<li><a href="' . nggcf_get_field($image->pid, 'Your Field Name Here' . '" title="' . $description . '">';

    Thread Starter Artem01

    (@artem01)

    Thank you so much for helping,

    But it is doesn’t work, because we receive a messege, that it was error in php. The file name is nggfeatured.php

    The full code:

    $out = '<li><a href="' . $image->imageURL . '" title="' . $description . '">';				// Typo fix for the next updates (happend until 1.0.2)
    				$instance['show'] = ( $instance['show'] == 'orginal' ) ? 'original' : $instance['show'];
    
    				if ( $instance['show'] == 'original' )
    					$out .= '<img src="' . home_url() .'/' . 'index.php?callback=image&pid='.$image->pid.'&width='.$instance['width'].'&height='.$instance['height']. '" title="'.$alttext.'" alt="'.$alttext.'" />';
    				else
    					$out .= '<img src="'.$image->thumbURL.'" width="'.$instance['width'].'" height="'.$instance['height'].'" title="'.$alttext.'" alt="'.$alttext.'" />';			
    
    				echo $out . '</a></li>'."\n";
    
    			}
    		}

    How I can put NGG Custom fields in these code?

    Plugin Author shauno

    (@shauno)

    Sorry, there was a missing closing brace in my last code snippet. Here is the replacement in your new sample:

    $out = '<li><a href="' . nggcf_get_field($image->pid, 'Your Field Name Here') . '" title="' . $description . '">';				// Typo fix for the next updates (happend until 1.0.2)
    				$instance['show'] = ( $instance['show'] == 'orginal' ) ? 'original' : $instance['show'];
    
    				if ( $instance['show'] == 'original' )
    					$out .= '<img src="' . home_url() .'/' . 'index.php?callback=image&pid='.$image->pid.'&width='.$instance['width'].'&height='.$instance['height']. '" title="'.$alttext.'" alt="'.$alttext.'" />';
    				else
    					$out .= '<img src="'.$image->thumbURL.'" width="'.$instance['width'].'" height="'.$instance['height'].'" title="'.$alttext.'" alt="'.$alttext.'" />';			
    
    				echo $out . '</a></li>'."\n";
    
    			}
    		}
    Thread Starter Artem01

    (@artem01)

    Thank you so much for helping,

    I have put this code and page is open, but it the Custom Fieds still didn’t working. The following page http://grevtsevpm.myjino.ru/ on the bottom 7 small photos.

    Can you please advice me, if it possible where is mistake?

    Plugin Author shauno

    (@shauno)

    Did you change the 'Your Field Name Here' text to the actual name of your field?

    Thread Starter Artem01

    (@artem01)

    Good day,

    Yes, I have changed the standart name, but it is doesn’t work

    Plugin Author shauno

    (@shauno)

    Are you editing the correct template?

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘NGG Custom Fields’ is closed to new replies.