• Resolved davidebr90

    (@davidebr90)


    Hi!
    I would like to see the EXIF data of the currently displayed thumbnail article (in widget area..)
    I tried to enter the code:

    <? php
    if (function_exists ('exifography_display_exif'))
    exifography_display_exif echo ();
    ?>

    to make it perform in the bar, but the result is a widget empty!
    how can I do?

    thanks!

    https://wordpress.org/plugins/thesography/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter davidebr90

    (@davidebr90)

    PS: i use also “Regenerate Thumbnails” plugin (lastest versio 2.2.4)

    Plugin Author kristarella

    (@kristarella)

    Hi Davide,

    Sorry for the delayed reply.

    You can add the following to your theme’s functions.php, or a plugin file if you have one to keep site-specific code snippets:

    // creates a shortcode to show EXIF outside the loop
    add_shortcode( 'widget_exif' , 'exif_outside_loop' );
    function exif_outside_loop() {
    	global $wp_query;
    	$post_ID = $wp_query->post->ID;
    	$img = get_post_thumbnail_id($post_ID);
    	if (function_exists ('exifography_display_exif'))
    	echo exifography_display_exif($img);
    }
    
    // enables shortcodes within widgets
    add_filter('widget_text', 'do_shortcode');

    Then add [widget_exif] to a text widget. NB you will probably need a plugin that restricts the widget to only single posts and this particular code will show the exif for the featured image.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show EXIF info in widget area’ is closed to new replies.