Most digital music, images and video contain metadata. This metadata (with a bit of code) can be used to make dynamic pages and posts. Information stored on the digital media (‘Tags’) can be copied by WordPress and inserted into your post or page.
And the best thing is, you don’t have to type a thing (other than the initial bit of code to make it work)…
For non WordPress users, I have another article on getID3. It explains a bit more about how to use it, outside of the WordPress framework.
getID3 is used in WordPress to extract the metadata from the multimedia files. It’s an open-source program distributed under the GNU General Public License (see the website getid3.org for more information).
If you’re using WordPress, getID3 is already included in the core WordPress files, so you don’t need to download getID3.
The files are located at:
wordpress\wp-includes\ID3
In other words… Your WordPress site folder which would be similar to either of these examples:
htdocs\example.com\wp-includes\ID3
public_html\example.com\wp-includes\ID3
To get ‘getID3’ to work in WordPress, you will need to tell WordPress to run the ‘media.php’ file. Otherwise, none of the WordPress metadata functions will work, and you may receive a ‘fatal error’ message like the one in the image below.
To run the ‘media.php’ file, type the following in your ‘functions.php’ file (or in the template file your using) and save the file:
require_once(ABSPATH . ‘wp-admin/includes/media.php’);
To extract and display the metadata, you will need a WordPress function(s) and some PHP code.
Here are some example WordPress functions that can manipulate the multimedia metadata:
A complete list of WordPress metadata functions can be found in the WordPress Reference by typing in metadata in the search box.
Here is an example where getID3 has been used to build a web page that displays a list of songs on a music player. getID3 has been used to automatically populate the fields in the music player.
When you add a song to the page, getID3 pulls out the metadata from the music file, and places it in the music player alongside the song. It’s great, you don’t have to type a thing!
Here’s a link to a working example:
Marie – My Songs (works in progress)
I have another article that explains more about how to use getID3 for non-WordPress users. It may also help you understand how getID3 works.