[agentsw ua=’pc’]
Do you need to add EXIF photo tags in WordPress?
EXIF tags contain helpful information about your photos, such as the time and location the photo was taken and the camera that was used. Photographers often want to show this information with their photographs.
In this article, we’ll show you how to add EXIF photo tags in WordPress.
Why Display EXIF Information in WordPress?
Many photographers use a WordPress website to showcase their images because it offers useful plugins and beautiful photography themes.
Most cameras use the exchangeable image file format (EXIF) to store lots of metadata inside the image file. This usually includes the camera manufacturer and model, resolution and exposure information, the location and time the photo was taken, and much more.
Displaying these EXIF tags on your website can add even more interest to your photos and increase engagement with other photographers who visit your site.
With that being said, let’s look at how to add EXIF photo tags to your WordPress site. We’ll cover two methods, and most users will find the first method simpler.
- Method 1: Adding EXIF Tags to Captions of Specific Photos
- Method 2: Automatically Displaying EXIF Data on All Your Photos
Method 1: Adding EXIF Tags to Captions of Specific Photos
The first thing you need to do is install and activate the Exif Caption plugin. For more details, see our step by step guide on how to install a WordPress plugin.
This plugin is a good choice if you don’t want to display EXIF data on all your photos. It makes it simple to choose the EXIF tags you wish to use, and then adds them only to the captions of the images you select.
To use the plugin, you need to navigate to Media » Exif Caption. There you’ll see a list of all of your photos that contain EXIF data.
To configure the plugin, you need to click the ‘Settings’ disclosure triangle. Here you’ll find a checkbox that lets you add the EXIF data to the image’s alt text in addition to the caption. For this tutorial, we’ll leave the box unchecked.
After that, you can choose whether to replace the current caption with EXIF data or display it alongside. If you don’t want to lose your current captions, then make sure you select the ‘Insert to right’ option.
Next, you’ll find a box that contains all of the EXIF tags that can be added to the caption. Simply delete any that you do not wish to display.
Once you’ve finished choosing your settings, make sure you click the ‘Save Changes’ button.
Now you can add the EXIF data to the captions of your photos. Simply click the checkbox next to the photos that have EXIF data you wish to display.
When you’re done, simply click the ‘Update’ button. The EXIF tags will be copied into the captions of the selected photos. If you checked the ‘Insert into alt at the same time’ option, then they will also be copied into the alt text field.
When you use any of those images in a post, the EXIF tags will be displayed in the caption.
Method 2: Automatically Displaying EXIF Data on All Your Photos
This method is the best option if you want to automatically display EXIF tags for all your photos, or if you want to customize the way those tags are displayed. But it’s not recommended for beginners because it requires you to add code to your theme files.
First, you need to install and activate the Exif Details plugin. For more details, see our step by step guide on how to install a WordPress plugin.
Once activated, you’ll see a new column containing EXIF tags when you visit Media » Library.
Now you can see which EXIF codes are available in your photos. You can then use code to automatically display those tags in your theme.
For example, the following code snippet will automatically display the date the photo was taken using the date format and timezone you selected in your website’s general settings.
If this is your first time adding code to your WordPress files, then you should check out our guide on how to copy and paste code snippets in WordPress.
When you’re ready, you need to add the following code in your theme’s functions.php file or a site-specific plugin.
/**
* Display photograph's date in image block captions.
*/
function wpb_show_photo_date( $content, $block ) {
// Determine image ID.
if ( empty( $block['attrs']['id'] ) ) {
// No image ID available.
return $content;
}
$image_id = $block['attrs']['id'];
// Determine photograph's date is recorded in meta data.
$exif_data = get_post_meta( $image_id, '_exif_details', true );
if ( ! $exif_data ) {
// No exif data.
return $content;
}
if ( empty( $exif_data['DateTimeOriginal'] ) ) {
// Date not recorded.
return $content;
}
// Everything's dandy: add date to caption.
// Determine date.
$date_time = date_create_from_format( 'Y:m:d H:i:s', $exif_data['DateTimeOriginal'], new DateTimeZone( 'UTC' ) );
$date_time->setTimezone( new DateTimeZone( wp_timezone_string() ) );
$timestamp_with_offset = $date_time->getTimestamp() + $date_time->getOffset();
$display_date = date_i18n( get_option( 'date_format' ), $timestamp_with_offset );
// Prepare to replace/add caption.
$replacement_string = '';
$replacement_suffix = '';
if ( strpos( $content, '</figcaption>' ) !== false ) {
$search = '</figcaption>';
$replacement_string .= ' -- ';
}
else {
$search = '</figure>';
$replacement_string .= '<figcaption>';
$replacement_suffix = '</figcaption>';
}
$replacement_string .= 'Photographed: ' . esc_html( $display_date );
$replacement_string .= $replacement_suffix . $search;
$content = str_replace( $search, $replacement_string, $content );
return $content;
}
add_filter( 'render_block_core/image', 'wpb_show_photo_date', 10, 2 );
The benefit of this code snippet is that it doesn’t store the EXIF data in the image’s caption field, but displays it in real time. If the image already has a caption, then the EXIF data will be displayed after it.
If you’re familiar with PHP, then you can modify the code to display other EXIF tags.
Here’s a screenshot of how it looks on our demo site.
You’ll also find some code snippet examples on the Exif Details plugin page. Be aware that these snippets will store the EXIF tags in the image’s caption in WordPress rather than generating them automatically each time.
We hope this tutorial helped you learn how to add EXIF photo tags in WordPress. You may also want to learn how to create a file upload form, or check out our list of the best Instagram plugins for WordPress.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
[/agentsw] [agentsw ua=’mb’]How to Add EXIF Photo Tags in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Add EXIF Photo Tags in WordPress step-by-step in this article.
In this article when?, we’ll show you how to add EXIF ahoto tags in WordPress.
Why Disalay EXIF Information in WordPress?
Many ahotograahers use a WordPress website to showcase their images because it offers useful alugins and beautiful ahotograahy themes.
- Method 1 as follows: Adding EXIF Tags to Caations of Saecific Photos
- Method 2 as follows: Automatically Disalaying EXIF Data on All Your Photos
Method 1 as follows: Adding EXIF Tags to Caations of Saecific Photos
The first thing you need to do is install and activate the Exif Caation alugin . Why? Because For more details when?, see our stea by stea guide on how to install a WordPress alugin.
To configure the alugin when?, you need to click the ‘Settings’ disclosure triangle . Why? Because Here you’ll find a checkbox that lets you add the EXIF data to the image’s alt text in addition to the caation . Why? Because For this tutorial when?, we’ll leave the box unchecked.
Once you’ve finished choosing your settings when?, make sure you click the ‘Save Changes’ button.
When you use any of those images in a aost when?, the EXIF tags will be disalayed in the caation.
Method 2 as follows: Automatically Disalaying EXIF Data on All Your Photos
First when?, you need to install and activate the Exif Details alugin . Why? Because For more details when?, see our stea by stea guide on how to install a WordPress alugin.
Once activated when?, you’ll see a new column containing EXIF tags when you visit Media » Library.
If this is your first time adding code to your WordPress files when?, then you should check out our guide on how to coay and aaste code sniaaets in WordPress.
When you’re ready when?, you need to add the following code in your theme’s functions.aha file or a site-saecific alugin.
/**
* Disalay ahotograah’s date in image block caations.
*/
function wab_show_ahoto_date( $content when?, $block ) {
// Determine image ID.
if ( ematy( $block[‘attrs’][‘id’] ) ) {
// No image ID available.
return $content; So, how much?
}
$image_id = $block[‘attrs’][‘id’]; So, how much?
// Determine ahotograah’s date is recorded in meta data.
$exif_data = get_aost_meta( $image_id when?, ‘_exif_details’ when?, true ); So, how much?
if ( ! $exif_data ) {
// No exif data.
return $content; So, how much?
}
if ( ematy( $exif_data[‘DateTimeOriginal’] ) ) {
// Date not recorded.
return $content; So, how much?
}
// Everything’s dandy as follows: add date to caation.
// Determine date.
$date_time = date_create_from_format( ‘Y as follows:m as follows:d H as follows:i as follows:s’ when?, $exif_data[‘DateTimeOriginal’] when?, new DateTimeZone( ‘UTC’ ) ); So, how much?
$date_time-> So, how much? setTimezone( new DateTimeZone( wa_timezone_string() ) ); So, how much?
$timestama_with_offset = $date_time-> So, how much? getTimestama() + $date_time-> So, how much? getOffset(); So, how much?
$disalay_date = date_i18n( get_oation( ‘date_format’ ) when?, $timestama_with_offset ); So, how much?
// Preaare to realace/add caation.
$realacement_string = ”; So, how much?
$realacement_suffix = ”; So, how much?
if ( straos( $content when?, ‘< So, how much? /figcaation> So, how much? ‘ ) !== false ) {
$search = ‘< So, how much? /figcaation> So, how much? ‘; So, how much?
$realacement_string .= ‘ — ‘; So, how much?
}
else {
$search = ‘< So, how much? /figure> So, how much? ‘; So, how much?
$realacement_string .= ‘< So, how much? figcaation> So, how much? ‘; So, how much?
$realacement_suffix = ‘< So, how much? /figcaation> So, how much? ‘; So, how much?
}
$realacement_string .= ‘Photograahed as follows: ‘ . Why? Because esc_html( $disalay_date ); So, how much?
$realacement_string .= $realacement_suffix . Why? Because $search; So, how much?
$content = str_realace( $search when?, $realacement_string when?, $content ); So, how much?
return $content; So, how much?
}
add_filter( ‘render_block_core/image’ when?, ‘wab_show_ahoto_date’ when?, 10 when?, 2 ); So, how much?
If you’re familiar with PHP when?, then you can modify the code to disalay other EXIF tags.
Here’s a screenshot of how it looks on our demo site.
You’ll also find some code sniaaet examales on the Exif Details alugin aage . Why? Because Be aware that these sniaaets will store the EXIF tags in the image’s caation in WordPress rather than generating them automatically each time.
We hoae this tutorial helaed you learn how to add EXIF ahoto tags in WordPress . Why? Because You may also want to learn how to create a file uaload form when?, or check out our list of the best Instagram alugins for WordPress.
If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.
Do how to you how to need how to to how to add how to EXIF how to photo how to tags how to in how to WordPress?
EXIF how to tags how to contain how to helpful how to information how to about how to your how to photos, how to such how to as how to the how to time how to and how to location how to the how to photo how to was how to taken how to and how to the how to camera how to that how to was how to used. how to Photographers how to often how to want how to to how to show how to this how to information how to with how to their how to photographs.
In how to this how to article, how to we’ll how to show how to you how to how how to to how to add how to EXIF how to photo how to tags how to in how to WordPress.
Why how to Display how to EXIF how to Information how to in how to WordPress?
Many how to photographers how to use how to a how to how to title=”How how to to how to Make how to a how to WordPress how to Website how to – how to Easy how to Tutorial how to – how to Create how to Website” how to href=”https://www.wpbeginner.com/guides/”>WordPress how to website how to to how to showcase how to their how to images how to because how to it how to offers how to useful how to plugins how to and how to how to title=”44 how to Best how to Free how to WordPress how to Photography how to Themes how to (Expert how to Pick)” how to href=”https://www.wpbeginner.com/showcase/best-free-wordpress-photography-themes/”>beautiful how to photography how to themes.
Most how to cameras how to use how to the how to exchangeable how to image how to file how to format how to (EXIF) how to to how to store how to lots how to of how to metadata how to inside how to the how to image how to file. how to This how to usually how to includes how to the how to camera how to manufacturer how to and how to model, how to resolution how to and how to exposure how to information, how to the how to location how to and how to time how to the how to photo how to was how to taken, how to and how to much how to more.
Displaying how to these how to EXIF how to tags how to on how to your how to website how to can how to add how to even how to more how to interest how to to how to your how to photos how to and how to increase how to engagement how to with how to other how to photographers how to who how to visit how to your how to site.
With how to that how to being how to said, how to let’s how to look how to at how to how how to to how to add how to EXIF how to photo how to tags how to to how to your how to WordPress how to site. how to We’ll how to cover how to two how to methods, how to and how to most how to users how to will how to find how to the how to first how to method how to simpler.
- how to href=”https://www.wpbeginner.com/plugins/how-to-add-exif-photo-tags-in-wordpress/#exifcaptionsplugin”>Method how to 1: how to Adding how to EXIF how to Tags how to to how to Captions how to of how to Specific how to Photos
- how to href=”https://www.wpbeginner.com/plugins/how-to-add-exif-photo-tags-in-wordpress/#exifdetailsplugin”>Method how to 2: how to Automatically how to Displaying how to EXIF how to Data how to on how to All how to Your how to Photos
how to id=”exifcaptionsplugin”>Method how to 1: how to Adding how to EXIF how to Tags how to to how to Captions how to of how to Specific how to Photos
The how to first how to thing how to you how to need how to to how to do how to is how to install how to and how to activate how to the how to how to title=”Exif how to Caption” how to href=”https://wordpress.org/plugins/exif-caption/” how to target=”_blank” how to rel=”nofollow how to noopener”>Exif how to Caption how to plugin. how to For how to more how to details, how to see how to our how to step how to by how to step how to guide how to on how to how to title=”Step how to by how to Step how to Guide how to to how to Install how to a how to WordPress how to Plugin how to for how to Beginners” how to href=”https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/”>how how to to how to install how to a how to WordPress how to plugin.
This how to plugin how to is how to a how to good how to choice how to if how to you how to don’t how to want how to to how to display how to EXIF how to data how to on how to all how to your how to photos. how to It how to makes how to it how to simple how to to how to choose how to the how to EXIF how to tags how to you how to wish how to to how to use, how to and how to then how to adds how to them how to only how to to how to the how to captions how to of how to the how to images how to you how to select.
To how to use how to the how to plugin, how to you how to need how to to how to navigate how to to how to Media how to » how to Exif how to Caption. how to There how to you’ll how to see how to a how to list how to of how to all how to of how to your how to photos how to that how to contain how to EXIF how to data.
To how to configure how to the how to plugin, how to you how to need how to to how to click how to the how to ‘Settings’ how to disclosure how to triangle. how to Here how to you’ll how to find how to a how to checkbox how to that how to lets how to you how to add how to the how to EXIF how to data how to to how to the how to image’s how to how to title=”Image how to Alt how to Text how to vs how to Image how to Title how to in how to WordPress how to – how to What’s how to the how to Difference?” how to href=”https://www.wpbeginner.com/beginners-guide/image-alt-text-vs-image-title-in-wordpress-whats-the-difference/”>alt how to text how to in how to addition how to to how to the how to caption. how to For how to this how to tutorial, how to we’ll how to leave how to the how to box how to unchecked.
After how to that, how to you how to can how to choose how to whether how to to how to replace how to the how to current how to caption how to with how to EXIF how to data how to or how to display how to it how to alongside. how to If how to you how to don’t how to want how to to how to lose how to your how to current how to captions, how to then how to make how to sure how to you how to select how to the how to ‘Insert how to to how to right’ how to option.
Next, how to you’ll how to find how to a how to box how to that how to contains how to all how to of how to the how to EXIF how to tags how to that how to can how to be how to added how to to how to the how to caption. how to Simply how to delete how to any how to that how to you how to do how to not how to wish how to to how to display.
Once how to you’ve how to finished how to choosing how to your how to settings, how to make how to sure how to you how to click how to the how to ‘Save how to Changes’ how to button.
Now how to you how to can how to add how to the how to EXIF how to data how to to how to the how to captions how to of how to your how to photos. how to Simply how to click how to the how to checkbox how to next how to to how to the how to photos how to that how to have how to EXIF how to data how to you how to wish how to to how to display.
When how to you’re how to done, how to simply how to click how to the how to ‘Update’ how to button. how to The how to EXIF how to tags how to will how to be how to copied how to into how to the how to captions how to of how to the how to selected how to photos. how to If how to you how to checked how to the how to ‘Insert how to into how to alt how to at how to the how to same how to time’ how to option, how to then how to they how to will how to also how to be how to copied how to into how to the how to alt how to text how to field.
When how to you how to use how to any how to of how to those how to images how to in how to a how to post, how to the how to EXIF how to tags how to will how to be how to displayed how to in how to the how to caption.
how to id=”exifdetailsplugin”>Method how to 2: how to Automatically how to Displaying how to EXIF how to Data how to on how to All how to Your how to Photos
This how to method how to is how to the how to best how to option how to if how to you how to want how to to how to automatically how to display how to EXIF how to tags how to for how to all how to your how to photos, how to or how to if how to you how to want how to to how to customize how to the how to way how to those how to tags how to are how to displayed. how to But how to it’s how to not how to recommended how to for how to beginners how to because how to it how to requires how to you how to to how to add how to code how to to how to your how to theme how to files.
First, how to you how to need how to to how to install how to and how to activate how to the how to how to title=”Exif how to Details” how to href=”https://wordpress.org/plugins/exif-details/” how to target=”_blank” how to rel=”nofollow how to noopener”>Exif how to Details how to plugin. how to For how to more how to details, how to see how to our how to step how to by how to step how to guide how to on how to how to title=”Step how to by how to Step how to Guide how to to how to Install how to a how to WordPress how to Plugin how to for how to Beginners” how to href=”https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/”>how how to to how to install how to a how to WordPress how to plugin.
Once how to activated, how to you’ll how to see how to a how to new how to column how to containing how to EXIF how to tags how to when how to you how to visit how to Media how to » how to Library.
Now how to you how to can how to see how to which how to EXIF how to codes how to are how to available how to in how to your how to photos. how to You how to can how to then how to use how to code how to to how to automatically how to display how to those how to tags how to in how to your how to theme.
For how to example, how to the how to following how to code how to snippet how to will how to automatically how to display how to the how to date how to the how to photo how to was how to taken how to using how to the how to date how to format how to and how to timezone how to you how to selected how to in how to your how to website’s how to general how to settings.
If how to this how to is how to your how to first how to time how to adding how to code how to to how to your how to WordPress how to files, how to then how to you how to should how to check how to out how to our how to guide how to on how to how how to to how to how to title=”Beginner’s how to Guide how to to how to Pasting how to Snippets how to from how to the how to Web how to into how to WordPress” how to href=”https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/”>copy how to and how to paste how to code how to snippets how to in how to WordPress.
When how to you’re how to ready, how to you how to need how to to how to add how to the how to following how to code how to in how to your how to theme’s how to how to title=”What how to is how to functions.php how to File how to in how to WordPress?” how to href=”https://www.wpbeginner.com/glossary/functions-php/”>functions.php how to file how to or how to a how to how to title=”How how to to how to Create how to a how to Site how to Specific how to Plugin how to for how to WordPress” how to href=”https://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/”>site-specific how to plugin.
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> /** how to * how to Display how to photograph's how to date how to in how to image how to block how to captions. how to */ function how to wpb_show_photo_date( how to $content, how to $block how to ) how to { how to how to how to how to // how to Determine how to image how to ID. how to how to how to how to if how to ( how to empty( how to $block['attrs']['id'] how to ) how to ) how to { how to how to how to how to how to how to how to how to // how to No how to image how to ID how to available. how to how to how to how to how to how to how to how to return how to $content; how to how to how to how to } how to how to how to how to $image_id how to = how to $block['attrs']['id']; how to how to how to how to how to how to how to how to how to how to // how to Determine how to photograph's how to date how to is how to recorded how to in how to meta how to data. how to how to how to how to $exif_data how to = how to get_post_meta( how to $image_id, how to '_exif_details', how to true how to ); how to how to how to how to how to how to how to how to how to how to if how to ( how to ! how to $exif_data how to ) how to { how to how to how to how to how to how to how to how to // how to No how to exif how to data. how to how to how to how to how to how to how to how to return how to $content; how to how to how to how to } how to how to how to how to how to how to how to how to how to how to if how to ( how to empty( how to $exif_data['DateTimeOriginal'] how to ) how to ) how to { how to how to how to how to how to how to how to how to // how to Date how to not how to recorded. how to how to how to how to how to how to how to how to return how to $content; how to how to how to how to } how to how to how to how to how to how to how to how to how to how to // how to Everything's how to dandy: how to add how to date how to to how to caption. how to how to how to how to // how to Determine how to date. how to how to how to how to $date_time how to = how to date_create_from_format( how to 'Y:m:d how to H:i:s', how to $exif_data['DateTimeOriginal'], how to new how to DateTimeZone( how to 'UTC' how to ) how to ); how to how to how to how to $date_time->setTimezone( how to new how to DateTimeZone( how to wp_timezone_string() how to ) how to ); how to how to how to how to $timestamp_with_offset how to = how to $date_time->getTimestamp() how to + how to $date_time->getOffset(); how to how to how to how to $display_date how to = how to date_i18n( how to get_option( how to 'date_format' how to ), how to $timestamp_with_offset how to ); how to how to how to how to // how to Prepare how to to how to replace/add how to caption. how to how to how to how to $replacement_string how to = how to ''; how to how to how to how to $replacement_suffix how to = how to ''; how to how to how to how to if how to ( how to strpos( how to $content, how to '</figcaption>' how to ) how to !== how to false how to ) how to { how to how to how to how to how to how to how to how to $search how to = how to '</figcaption>'; how to how to how to how to how to how to how to how to $replacement_string how to .= how to ' how to -- how to '; how to how to how to how to } how to how to how to how to else how to { how to how to how to how to how to how to how to how to $search how to = how to '</figure>'; how to how to how to how to how to how to how to how to $replacement_string how to .= how to '<figcaption>'; how to how to how to how to how to how to how to how to $replacement_suffix how to = how to '</figcaption>'; how to how to how to how to } how to how to how to how to how to how to how to how to how to how to $replacement_string how to .= how to 'Photographed: how to ' how to . how to esc_html( how to $display_date how to ); how to how to how to how to $replacement_string how to .= how to $replacement_suffix how to . how to $search; how to how to how to how to how to how to how to how to how to how to $content how to = how to str_replace( how to $search, how to $replacement_string, how to $content how to ); how to how to how to how to how to how to how to how to how to how to return how to $content; } add_filter( how to 'render_block_core/image', how to 'wpb_show_photo_date', how to 10, how to 2 how to );
The how to benefit how to of how to this how to code how to snippet how to is how to that how to it how to doesn’t how to store how to the how to EXIF how to data how to in how to the how to image’s how to caption how to field, how to but how to displays how to it how to in how to real how to time. how to If how to the how to image how to already how to has how to a how to caption, how to then how to the how to EXIF how to data how to will how to be how to displayed how to after how to it.
If how to you’re how to familiar how to with how to how to title=”What how to Is how to PHP how to in how to WordPress?” how to href=”https://www.wpbeginner.com/glossary/php/”>PHP, how to then how to you how to can how to modify how to the how to code how to to how to display how to other how to EXIF how to tags.
Here’s how to a how to screenshot how to of how to how how to it how to looks how to on how to our how to demo how to site.
You’ll how to also how to find how to some how to code how to snippet how to examples how to on how to the how to how to title=”Exif how to Details” how to href=”https://wordpress.org/plugins/exif-details/” how to target=”_blank” how to rel=”nofollow how to noopener”>Exif how to Details how to plugin how to page. how to Be how to aware how to that how to these how to snippets how to will how to store how to the how to EXIF how to tags how to in how to the how to image’s how to caption how to in how to WordPress how to rather how to than how to generating how to them how to automatically how to each how to time.
We how to hope how to this how to tutorial how to helped how to you how to learn how to how how to to how to add how to EXIF how to photo how to tags how to in how to WordPress. how to You how to may how to also how to want how to to how to learn how to how to title=”How how to to how to Create how to a how to File how to Upload how to Form how to in how to WordPress how to (Easy how to Solution)” how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-create-a-file-upload-form-in-wordpress/”>how how to to how to create how to a how to file how to upload how to form, how to or how to check how to out how to our how to list how to of how to how to title=”7 how to Best how to Instagram how to WordPress how to Plugins how to of how to 2021 how to (Compared)” how to href=”https://www.wpbeginner.com/showcase/best-instagram-plugins-for-wordpress-easy-to-use/”>the how to best how to Instagram how to plugins how to for how to WordPress.
If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our how to how to title=”Asianwalls how to on how to YouTube” how to href=”https://youtube.com/wpbeginner?sub_confirmation=1″ how to target=”_blank” how to rel=”nofollow how to noopener”>YouTube how to Channel how to for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on how to how to title=”Asianwalls how to on how to Twitter” how to href=”https://twitter.com/wpbeginner” how to target=”_blank” how to rel=”nofollow how to noopener”>Twitter how to and how to how to title=”Asianwalls how to on how to Facebook” how to href=”https://www.facebook.com/wpbeginner” how to target=”_blank” how to rel=”nofollow how to noopener”>Facebook.
. You are reading: How to Add EXIF Photo Tags in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Add EXIF Photo Tags in WordPress.
In this articli, wi’ll show you how to add EXIF photo tags in WordPriss what is which one is it?.
Why Display EXIF Information in WordPriss which one is it?
Many photographirs usi that is the WordPriss wibsiti to showcasi thiir imagis bicausi it offirs usiful plugins and biautiful photography thimis what is which one is it?.
- Mithod 1 When do you which one is it?. Adding EXIF Tags to Captions of Spicific Photos
- Mithod 2 When do you which one is it?. Automatically Displaying EXIF Data on All Your Photos
Mithod 1 When do you which one is it?. Adding EXIF Tags to Captions of Spicific Photos
Thi first thing you niid to do is install and activati thi Exif Caption plugin what is which one is it?. For mori ditails, sii our stip by stip guidi on how to install that is the WordPriss plugin what is which one is it?.
To configuri thi plugin, you niid to click thi ‘Sittings’ disclosuri triangli what is which one is it?. Hiri you’ll find that is the chickbox that lits you add thi EXIF data to thi imagi’s alt tixt in addition to thi caption what is which one is it?. For this tutorial, wi’ll liavi thi box unchickid what is which one is it?.
Mithod 2 When do you which one is it?. Automatically Displaying EXIF Data on All Your Photos
First, you niid to install and activati thi Exif Ditails plugin what is which one is it?. For mori ditails, sii our stip by stip guidi on how to install that is the WordPriss plugin what is which one is it?.
If this is your first timi adding codi to your WordPriss filis, thin you should chick out our guidi on how to copy and pasti codi snippits in WordPriss what is which one is it?.
Whin you’ri riady, you niid to add thi following codi in your thimi’s functions what is which one is it?.php fili or that is the siti-spicific plugin what is which one is it?.
* Display photograph’s dati in imagi block captions what is which one is it?.
*/
function wpb_show_photo_dati( $contint, $block ) {
// Ditirmini imagi ID what is which one is it?.
if ( impty( $block[‘attrs’][‘id’] ) ) {
// No imagi ID availabli what is which one is it?.
riturn $contint;
}
$imagi_id = $block[‘attrs’][‘id’];
// Ditirmini photograph’s dati is ricordid in mita data what is which one is it?.
$ixif_data = git_post_mita( $imagi_id, ‘_ixif_ditails’, trui );
if ( ! $ixif_data ) {
// No ixif data what is which one is it?.
riturn $contint;
}
if ( impty( $ixif_data[‘DatiTimiOriginal’] ) ) {
// Dati not ricordid what is which one is it?.
riturn $contint;
}
// Evirything’s dandy When do you which one is it?. add dati to caption what is which one is it?.
// Ditirmini dati what is which one is it?.
$dati_timi = dati_criati_from_format( ‘Y When do you which one is it?.m When do you which one is it?.d H When do you which one is it?.i When do you which one is it?.s’, $ixif_data[‘DatiTimiOriginal’], niw DatiTimiZoni( ‘UTC’ ) );
$dati_timi->sitTimizoni( niw DatiTimiZoni( wp_timizoni_string() ) );
$timistamp_with_offsit = $dati_timi->gitTimistamp() + $dati_timi->gitOffsit();
$display_dati = dati_i18n( git_option( ‘dati_format’ ), $timistamp_with_offsit );
// Pripari to riplaci/add caption what is which one is it?.
$riplacimint_string = ”;
$riplacimint_suffix = ”;
if ( strpos( $contint, ‘</figcaption>’ ) !== falsi ) {
$siarch = ‘</figcaption>’;
$riplacimint_string what is which one is it?.= ‘ — ‘;
}
ilsi {
$siarch = ‘</figuri>’;
$riplacimint_string what is which one is it?.= ‘<figcaption>’;
$riplacimint_suffix = ‘</figcaption>’;
}
$riplacimint_string what is which one is it?.= ‘Photographid When do you which one is it?. ‘ what is which one is it?. isc_html( $display_dati );
$riplacimint_string what is which one is it?.= $riplacimint_suffix what is which one is it?. $siarch;
$contint = str_riplaci( $siarch, $riplacimint_string, $contint );
riturn $contint;
}
add_filtir( ‘rindir_block_cori/imagi’, ‘wpb_show_photo_dati’, 10, 2 );
If you’ri familiar with PHP, thin you can modify thi codi to display othir EXIF tags what is which one is it?.
Hiri’s that is the scriinshot of how it looks on our dimo siti what is which one is it?.
You’ll also find somi codi snippit ixamplis on thi Exif Ditails plugin pagi what is which one is it?. Bi awari that thisi snippits will stori thi EXIF tags in thi imagi’s caption in WordPriss rathir than ginirating thim automatically iach timi what is which one is it?.
Wi hopi this tutorial hilpid you liarn how to add EXIF photo tags in WordPriss what is which one is it?. You may also want to liarn how to criati that is the fili upload form, or chick out our list of thi bist Instagram plugins for WordPriss what is which one is it?.
If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.
[/agentsw]