Using the new extended gallery features of the M-Theater WordPress Theme

Page Sections

Introducing Galleries by Hit.Pictures

M Theater 1.3.1 features a new way of creating and sharing galleries of image files. It’s just as easy – if not easier – than creating a standard WP gallery.

The meta box panel in it's default position.
The meta box panel in it’s default position.

To use the new features, you’ll use a new Meta Box located within your Edit Post or Edit Page window, titled ‘Galleries by Hit.Pictures.’ Use the fields to setup your options, then press the blue Update or Update Code buttons to generate a shortcode that you can place within your post or page. The shortcode will start [mtgallery …].

Once you become more familiar with the process, you can manually create your shortcodes for use in your content, without completing the fields. The input fields are only meant as helpful tools, until you become familiar with all of the available options.

You can also use sitewide settings to create options that will be consistent with all of your galleries, such as images per page, gallery type and thumbnail size. Global settings are overridden first by direct shortcode attributes, then by post field entries, in that order. Direct shortcode attributes override all other selections.

Example of a direct shortcode attribute: [mtgallery type=”mosaic”]
In this case ‘type’ is the attribute. ‘Type’ is the style of gallery you choose and ‘mosaic’ is an option.

If an attribute is not included in your shortcode, all options have defaults setup.

Currently Available Attributes

type

Gallery style to use on your images

  • Applies to gallery types: all
  • Possible values: mosaic, stack, slider, picturebook, jumble
  • Default value: If not included in your shortcode, this will default to the sitewide settings value.

Example
To display gallery style mosaic, you would use the following shortcode:
[mtgallery type=”mosaic”]

id

Post ID

  • Applies to gallery types: all
  • Possible values: Any post or page ID.
  • Default value: The current post or page the shortcode is being applied to.

Example
To display images from $post ID “722”, you would use the following shortcode:
[mtgallery id=”722″]

include

Attachment IDs to include

  • Applies to gallery types: all
  • Possible values: Comma separated list of attachment IDs to include in your gallery. NOTE: Do not add spaces between the IDs
  • Default value: All image attachments of current post or page, or those attached to the ID selected using id attribute.

Example
To display attachments with specific IDs, you would use the following shortcode:
[mtgallery include=”7,10,19,27,43,88,142″]

exclude

Attachment IDs to exclude

  • Applies to gallery types: all
  • Possible values: Comma separated list of attachment IDs to exclude. NOTE: Do not add spaces between the IDs
  • Default value: All image attachments of current post or page, or those attached to the ID selected using id attribute.

Example
To exclude attachments with specific IDs, you would use the following shortcode:
[mtgallery exclude=”310,456,759″]

align

Custom alignment for picturebook cover preview

  • Applies to gallery types: picturebook
  • Possible values: left (with text wrap), right (with text wrap), center.
  • Default value: center

Example
The following shortcode will left align the cover preview of picturebooks “left” and wrap text in your post to the right side of it:
[mtgallery align=”left”]

title

Title for books

  • Applies to gallery types: picturebook
  • Possible values: This can be a custom title your select (example: title=”My Photo Album”)
  • Default value: If not specified in your shortcode, this will default to the title of your post/page.

Example
The following shortcode will add the title “My Photo Album” to your picturebook:
[mtgallery title=”My Photo Album”]

covercolor

Cover color for books

  • Applies to gallery types: picturebook
  • Possible values: Use any Hex color. NOTE: Do not include hash (#)
  • Default value: If not specified in your shortcode, this will default to the sitewide settings value.

Example
The following shortcode will add the color “#000033” to your picturebook’s front and back covers (Notice there is no hash {#} symbol):
[mtgallery covercolor=”000033″]

ids

Same as ‘include’, carryover from standard WP gallery attributes

  • Applies to gallery types: all
  • Possible values: Comma separated list of attachment IDs to include in your gallery (example: include=”7,10,19,27,43,88,142″ will only display attachments with these IDs) NOTE: Do not add spaces between the IDs
  • Default value: All image attachments of current post or page, or those attached to the ID selected using id attribute.

Example
To display attachments with specific IDs, you would use the following shortcode:
[mtgallery ids=”7,10,19,27,43,88,142″]

size

Thumbnail image size

  • Applies to gallery types: all
  • Possible values: Valid values include “thumbnail”, “medium”, “large”, “full” and any other additional image size that was registered with add_image_size(). NOTE: You should only use this attribute when you have become familiar with the various gallery types and images sizes associated with your website.
  • Default value: Each gallery type has a recommended value that will be used if this attribute is left blank.

Example
To display attachments with specific IDs, you would use the following shortcode:
[mtgallery size=”medium”]

per

Number of images per page

  • Applies to gallery types: stack, mosaic and jumbled polaroids
  • Possible values: Any numerical value
  • Default value: If not included in your shortcode, this will default to the sitewide settings value.

Example
To display “30” attachments per page and add pagination to the bottom of each group of images, you would use the following shortcode:
[mtgallery per=”30″]

includetitle

Whether or not to include titles.

  • Applies to gallery types: Jumbled Polaroids
  • Possible values: true or false
  • Default value: true

Example:
To turn titles under each photo on Jumbled Polaroids, use the following shortcode:
[mtgallery includetitle=”false”]

category

You can optionally add a category of images to your galleries. This category of attachments will be added to images attached to your post or page.

  • Applies to gallery types: all
  • Possible values: The slug of any category of attachments.
  • Default value: None

Example:
To add a category named ‘Travel Images,’ with the slug ‘travel-images,’ use the following shortcode:
[mtgallery category=”travel-images”]

order

You have the option of sorting the IDs of your attachments in ascending (ASC) or descending (DESC) order.

  • Applies to gallery types: all
  • Possible values: ASC or DESC
  • Default value: DESC

Example:
To sort the IDs of your gallery in ascending order, use the following shortcode:
[mtgallery order=”ASC”]

cover

The URL to any image to use as a cover for picturebooks.

  • Applies to gallery types: Picturebooks
  • Possible values: The complete URL to an image.
  • Default value: The last image uploaded to your post or page.

Example:
To add a URL to an image to use as a cover for your picturebook, use the following shortcode:
[mtgallery cover=”http://www.link/to/your/selected/cover/image.jpg”]

Using Multiple Attributes

This is how the shortcode looks with multiple attributes:

[mtgallery id=”8147″ type=”mosaic” size=”medium”]

You do not need to fill out every attribute if you are setting up your own [mtgallery] shortcodes. In many cases, default values work fine. Also, certain attributes only apply to select gallery types and have no affect on others.

Gallery Types

There are currently 5 gallery styles to choose from. Below are screenshots representing the visual look of each style.

Global (Sitewide) Options

The sitewide options available to you with Hit>Pictures, allows you to set values that will keep your galleries consistent throughout your website, without having to use most attributes. They also speed up the transition process if you already have a large number of standard [gallery] shortcodes on your website.

Access sitewide options on M Theater’s Theme Options page (Appearance > Theme Options). There you will find all currently available fields, as well as the optional sitewide override of the WordPress [gallery] shortcode. NOTE: If you override the WordPress [gallery] shortcode, it will no longer function normally. Any further usage will function under the global settings you have set up in sitewide options.

[gallery] will become an alias of [mtgallery].

FAQ

If you don’t see the answer to your question below, use the comments section to ask. I will reply as soon as possible.

Q: Do any gallery styles allow for captions to be included?
A: Not currently, however the picturebook style allows you to add a detailed description to each image, which is included underneath on each page. Also, by default the jumbled polaroids style includes image titles, which can be edited to be short captions. These titles an optionally be turned off completely using the ‘includetitle’ attribute ([mtgallery includetitle=”false”]).

Q: I already have a large number of standard [gallery] shortcodes on my website. Can I override them to avoid having to change each one manually?
A: Yes. Go into M Theater’s Theme Options (Appearance > Theme Options). There you can activate a sitewide override of the WordPress [gallery] shortcode. Set global options there as well and those will be used on all existing [gallery] shortcodes. Any new galleries you create will also have these options, if you just use [mtgallery]. They can also be overridden using attributes or per post/page meta values.

Q: Do I have to use the meta fields to create my shortcodes, or can I just manually write them with my selected attributes?
A: Yes, you can manually write your shortcodes. The meta fields are only meant to be used as a guide to properly format your shortcodes. Attribute values also override meta field and global values, so you can change your options directly within the generated shortcode, once it’s in your content. For example, if you generate a shortcode with gallery type mosaic, it will look like this: [mtgallery type=”mosaic”].

Once that shortcode is placed in your content, you may decide to change the gallery type to stacked. You can simply type stacked, so your code will now be: [mtgallery type=”stacked”].

Get M-Theater with Hit.Pictures

You can purchase M-Theater with Hit.Pictures Galleries installed at byhandmedia.net/mtheater.