How to use the plugin

mmdb-logoThe My-Movie-Database (mmdb) plugin can be used via  shortcodes or  inside wordpress posts (and post types).

After installing the plugin three custom post types are created in wordpress: Movies, TvShows and Persons.

You can disable any one of them (or all of them if you want to use this plugin only via shortcode) by going into the Advanced options tab of the Movie Database options and selecting “No” for the post types you don’t want.

The shortcode method will always be available for all resource types (Movies, TvShows, etc) regardless of the state of the mmdb options for each post type.

Below is an outline of the two methods: WordPress posts and shortcodes

Using the plugin with WordPress posts

So as was mentioned above, by default the plugin will create three custom post types in wordpress: Movies, TvShows and Persons.

These custom post types are just like your regular wordpress posts except that they have a Movie, TvShow or Person section .

Adding a New Movie (or editing a Movie post):

Below the content textarea of your Movie post you will find the search  field.

1-) Enter the title of the movie you are looking for and click on search.

2-) You will then be presented with the search results.

search-results

 

3-) Click on the desired movie. A pop up will appear asking you to confirm your selection or to return to the previous page.

confirm-selection

4-) Once you have confirmed your selection click to save (or update) your post.

That’s it! Now if you navigate to the url of your post (front-end), the movie information will be displayed.

Configuration and customization of display

From the plugin option page you can select:

  • which template will be used to display your resource, and
  • if this should appear before or after the post content
  • which sections to display/hide, as well as
  • the header and body  colors for the available templates

For the Movie posts only  (in the advanced configuration option tab) :

  • You have the option of using the default wordpress posts instead of a new custom post type.
  • You also have the option of renaming the default WP posts into movies or leaving them as is (‘Posts’).

See the configuration documentation page  for more detailed info.

All the of the above apply for TvShows and Persons as well.

Using the plugin with shortcodes

The plugin shortcode is [my_movie_db].

  • The basic parameters that you need to set are  id  and type.
  • Optional parameters to override the global plugin settings are : template, size, body (color) and header (color).

The most important parameter is the id of the movie, tvshow or person info you wish to display. This parameter corresponds to the unique id of the resource at the TMDb website .

You can find the id by searching for the movie, tvshow or person at the TMDb website or in the respective custom post type edit screen in your wordpress backend.

a-) Searching at the TMDb website b-) Searching at your custom post type edit screen

Once you find the desired id you use it as in the following example: [my_mοvie_db id=yοur_id]

If you don't specify an id the id of 655 will be used.

This other important parameter corresponds to the type of resource you are looking for. Possible acceptable values for "type" are:

  • movie
  • tvshow
  • person

So for example if you are looking to display a tvshow your shortcode should look like this:

[my-mοvie-db id=yοur_id type=tvshow]

The default type value is "movie" so if you don't specify the type, the movie type will be used.

  • The template file parameter should be the name of the file without the ".php" (the extension).
  • Current templates available are tabs and accordion.

The template files are located inside the "mmdb_templates" folder of the 'my_movie_database" plugin.

So if for example you want to use the accordion.php template file your shortcode will look like this:

[my-mοvie-db id=your_id type=yοur_type template=accordion]

This will use the file in the folder path /mmdb_templates/yourtype/accordion.php ("your_type" can be movie, tvshow or person).

If you want to make/use your own template:

  • Use the custom.php file that is found in the same folder (recommended). The custom template is empty by default..
  • Or create a new file. Make sure you place it in the correct subfolder.

If you want to edit the default templates or use the custom template, please copy the "mmdb_templates" folder inside your active theme folder. This way any changes you make to your template files will not be overwritten by a plugin update.

Depending on the width setup/style of your target page, you can select from a predetermined set of width combinations for a best fit. This setting only affects bootstrap multiple column arrangements (for now) as seen on sections like cast and crew.

For example, if you have a full-width area with a no sidebar layout you would choose ' large ', ' medium ' if you have one sidebar and ' small ' for a two sidebar area.

So if for example you want to use the large size option, your shortcode will look like this:

[my-mοvie-db id=your_id type=yοur_type size=large]

The width options and the bootstrap classes rendered for multiple column arrangements:

large => for Full-width => renders 'col-lg-3 col-md-3 col-sm-6'
medium => for one sidebar =>renders 'col-lg-3 col-md-4 col-sm-6'
small => ‘for two sidebars =>renders 'col-lg-4 col-md-6 col-sm-6'

The background color for the template 'header' area

The template 'header' area will affect your tabs or accordion headers. In the case of tabs, the selected and the hovered tabs will get this color as well.

This setting in combination with the 'Background color for the template body' gives 2 color schemes to your tabs and accordion templates.

So if you want to use #333333 as a header background color, your shortcode will look like this:

[my-mοvie-db id=your_id type=yοur_type size=large header=#333333]

Make sure you use a valid css color, otherwise it will obviously not have any effect.

The background color for the template 'body' area

So if you want to use #333333 as a body background color, your shortcode will look like this:

[my-mοvie-db id=your_id type=yοur_type size=large body=#333333]

Make sure you use a valid css color, otherwise it will obviously not have any effect.

Configuration and customization of display

From the plugin options page you can select which sections to display/hide.

See the configuration documentation page  for more detailed info.