WordPress Plugin: Movie Shortcode
Table of contents
- Basic usage
- Open information
- Refining search results
- Custom cache timeout
- Via WordPress
Do you blog about movies or tv shows? It can be a tedious job adding movie information such as synopsis, genres, directors, cast and crew, or finding the correct artwork. Why not use a simple WordPress shortcode to do all the hard work for you.
F13s Movie Shortcode allows you to insert movie, tv show or episode information using an IMDB ID or a title and year, cutting out all the hard work.
Artwork is copied directly to your WordPress Media Library to ensure it’s always available when it’s needed and the whole plugin is cached using transient to ensure a faster page loading time.
- Responsive design
- Shows film title, year, release date
- If showing a series, the total number of seasons is displayed
- If showing an episode, the season and episode number are displayed
- Displays the plot or synopsis
- Displays a poster image if one is available
- If a poster image is available it is added to your media library and loaded locally
- Displays movie stats such as the runtime, genre, awards, director, writer, Actors
- Displays the available languages and country of origin
- Provides the IMDB rating, including a star rating image
- Adds a link to the movie on IMDB
- Utilizes transient caching to reduce page load times and api calls
The movie shortcode allows information to be gathered about a movie, tv show or episode such as ratings, plot, artwork and general information.
- imdb: An IMDB ID such as “tt13842136”
- title: A movie title such as “The Matrix”
- Year: The year a movie was released (optional)
- type: The type you are adding, one of [“movie”, “series” or “episode”] (optional)
- information: default “0”, if set to “1” the information box will be open by default (optional)
- cachetime: the desired cache timeout in minutes (optional)
Please note: One of “imdb” or “title” must be set.
Retrieving move information using a title:
[movie title="The Matrix"]
Plot: Thomas A. Anderson is a man living two lives. By day he is an average computer programmer and by night a hacker known as Neo. Neo has always questioned his reality, but the truth is far beyond his imagination. Neo finds himself targeted by the police when he is contacted by Morpheus, a legendary computer hacker branded a terrorist by the government. As a rebel against the machines, Neo must confront the agents: super-powerful computer programs devoted to stopping Neo and the entire human rebellion.
Runtime: 136 min
Genre: Action, Sci-Fi
Awards: Won 4 Oscars. 42 wins & 51 nominations total
Director: Lana Wachowski, Lilly Wachowski
Writer: Lilly Wachowski, Lana Wachowski
Actors: Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss
Country: United States, Australia
Retrieving movie information using an IMDB ID:
One Flew Over the Cuckoo's Nest
Plot: McMurphy has a criminal past and has once again gotten himself into trouble and is sentenced by the court. To escape labor duties in prison, McMurphy pleads insanity and is sent to a ward for the mentally unstable. Once here, McMurphy both endures and stands witness to the abuse and degradation of the oppressive Nurse Ratched, who gains superiority and power through the flaws of the other inmates. McMurphy and the other inmates band together to make a rebellious stance against the atrocious Nurse.
Runtime: 133 min
Awards: Won 5 Oscars. 38 wins & 16 nominations total
Director: Milos Forman
Writer: Lawrence Hauben, Bo Goldman, Ken Kesey
Actors: Jack Nicholson, Louise Fletcher, Michael Berryman
Country: United States
To open the information pane by default, include the argument information=1:
[movie imdb="tt13842136" information="1"]
Brooklyn Nine-Nine - Game of Boyles
Plot: Terry, Jake and Charles visit the Boyle Family Farm; Amy and Rosa help out Capt. Holt.
Runtime: 22 min
Genre: Comedy, Crime
Director: Thembi Banks
Writer: Dan Goor, Michael Schur, Paul Welsh
Actors: Andy Samberg, Stephanie Beatriz, Terry Crews
Country: United States
If you are receiving incorrect results, for example if there are multiple versions of the movie, include other optional arguments to refind the results:
[movie title="it" year="1990" type="series"]
Plot: In 1960, a group of social outcasts who are bullied by a gang of greasers led by Henry Bowers are also tormented by an evil demon who can shape-shift into a clown and feed on children's fears and kill them. After defeating the demonic clown as kids, it resurfaces thirty years later and they must finish it off as adults once again.
Runtime: 192 min
Genre: Drama, Horror, Mystery
Awards: Won 1 Primetime Emmy. 3 wins & 2 nominations total
Actors: Richard Thomas, Tim Reid, Annette O'Toole
Country: United States, Canada
Other than ratings, movie information is rarely updated. For this reason it is recommended to cache the data rather than run API calls on every page load. Newer releases may have rapidly changing ratings, whereas older releases are less likely to drastically change on an hourly basis. A custom cache timout can be included in the shortcode, set in minutes:
[movie imdb="tt0067023" cachetimeout="14400"]
Plot: While traveling through the desert for an appointment with a client, the businessman David Mann from California passes a slow and old tanker truck. The psychotic truck driver feels offended and chases David along the empty highway trying to kill him.
Runtime: 90 min
Genre: Action, Thriller
Awards: Won 1 Primetime Emmy. Another 2 wins & 5 nominations.
Director: Steven Spielberg
Writer: Richard Matheson (screenplay), Richard Matheson (story)
Actors: Dennis Weaver, Jacqueline Scott, Eddie Firestone, Lou Frizzell
Example output of F13 Movie Shortcode, showing Shuan of the Dead.
Installing is as simple as 1,2,3 –
- navigate to WP Admin > Plugins > Add New
- search for “F13 Movie”
- install and activate
- download the source code
- upload the “f13-movie” folder to your “wp-content/plugins” folder
- activate the plugin in wp-admin
Created: July 17, 2016 - 01:47pm
Last commit: October 30, 2021 - 09:11am
Open issues: 0
Description: Shortcode to add movie information to a WordPress blog, utilising the OMDB API
Description:Using Movie Shortcode you can easily add information about a movie, tv show or episode to a blog post.
Simply enter the shortcode: [movie imdb=”an IMDB ID”] or [Movie title=”A Movie ...
Version:2.0.1Requires WordPress:3.0.1+Tested with WordPress:5.8.3Requires PHP:+Created:July 21, 2016Last updated:October 29, 2021 5:02am