Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter pako69

    (@pako69)

    ok I find it but… how to add a missing IPTC field ?
    2#120 = Caption: (it’s ok)
    But i have also a Headline:, this one is not availaible in Table X

    Thread Starter pako69

    (@pako69)

    Oh yes “Recuperate IPTC and EXIF data from photos in WPPA+” save me!

    And now, a last question for IPTC ??

    Here is my description fied:
    <p>2#105<br />2#120</p>

    The first one (2#105) is a title (headline).
    Some images has got this information, sometimes not.
    If an image as not this information WPPA+ display: “not available”

    Is it possible to just display nothing if this field is empty ?

    Thanks a lot and excuse for my very bad english

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    You can edit wppa-exif-iptc-common.php
    line 55:

    .
    	// Remove untranslated
    	$pos = strpos($temp, '2#');
    	while ( $pos !== false ) {
    		$tmp = substr($temp, 0, $pos).__a('n.a.').substr($temp, $pos+5);
    		$temp = $tmp;
    		$pos = strpos($temp, '2#');
    	}

    Change to:

    .
    	// Remove untranslated
    	$pos = strpos($temp, '2#');
    	while ( $pos !== false ) {
    		$tmp = substr($temp, 0, $pos).substr($temp, $pos+5);
    		$temp = $tmp;
    		$pos = strpos($temp, '2#');
    	}

    i.e. remove: .__a('n.a.')

    Thread Starter pako69

    (@pako69)

    Thanks, it works but it keep some HTML tags:
    my description template is:
    <p><strong>2#105</strong> | 2#120</p>

    How completly remove the string <strong>2#105</strong> |
    and just keep: <p>2#120</p> if no Headline is set?

    Thread Starter pako69

    (@pako69)

    option: ‘Run wpautop on description’ checked
    and changed my description with only:

    <strong>2#105</strong>
    2#120

    and it works… ??

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    You could place the optional text in a div or span tag, test with a js script if the content of the strong tag is empty, and if so, remove the innerhtml of the div or span.

    A sketch:

    <p><span id="opt" ><span style="font-weight:bold" id="iptctag" >2#105</span> | </span>2#120</p>
    <script type="text/javascript">
    if ( jQuery('#iptctag').html == '' ) jQuery('#opt').html = '';
    </script>

    Or the like… ( the above code is not tested )

    Thread Starter pako69

    (@pako69)

    Thanks, i’ll try

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘IPTC caption as image description’ is closed to new replies.