Shortcode [photo]


There is a special - simple - shortcode to display a single image (photo or video).
The syntax is: [photo nnn] where nnn is the photo id.
Example: [photo 4668] produces:

You can configure in Basic settings -> Photos -> II: Shortcode [photo ... ] specifications what the shortcode [photo] stands for.
You can configure it to be one of the folowing four possible display types:

  • A plain single photo, in [wppa] shortcode known as type="photo"
  • A single photo with caption, in [wppa] shortcode known as type="mphoto"
  • A single photo with extended caption, in [wppa] shortcode known as type="xphoto"
  • A single photo in the style of a slideshow, in [wppa] shortcode known as type="slphoto"

For 'simple' users who can add/edit posts and/or comments there is a simple shortcode generator available on the wp editor in 'Visual' mode. See the icon in the toolbar above the wp editor.

Availablility at the front-end

Some plugins offer the possibility to edit posts etc. at the front-end of the website.
You can enable this feature by selecting shortcode in Basic settings -> Photos -> II: Shortcode [photo ... ] specifications -> Item 4: Fe type.
Examples of plugins that do support this are:

These plugins use the wp editor - at least they use the php function wp_editor() - to edit posts/replies.
For as far as it is technically possible, wppa's shortcode generator is also available on the wp editor instances in the plugins that use it.

Compatibility with other plugins
  • WP User Frontend
    This plugin is compatible without any restriction. It is recommended to add in the plugins custom css on its Settings -> General Options page:

    #wpuf-insert-image-container {

    This will hide the button to insert a native wp media photo.

  • bbPress
    To get this plugin compatible with the [photo] shortcode:
    - Tick the box in Advanced settings -> Misc -> IV: Other plugins related settings -> Item 9: Shortcode [photo nnn] on bbPress.
    Recommended other settings:
    - Basic settings -> Photos -> II: Shortcode [photo ... ] specifications -> Item 2: Size Not larger than 440;
    - Basic settings -> Photos -> II: Shortcode [photo ... ] specifications -> Item 3: Align --- none --- or right.
Alternative code insertions

For plugins that do not properly process textual content resulting in not processing shortcodes, WPPA offers two alternative code snippets that will be inserted in the text content of the editor. Both alternatives have their restrictions, so select the one that suits your needs best, and keep the restrictions in mind!

  • html
    This choice will insert - more or less - the html code that would be generated if the shortcode was processed properly. It is made using a template, what means that you can only configure the Single Image Type: A plain single image. Subtitles will be wrong. The editor will damage the code a bit: you can link to lightbox, but you should not use social media buttons in lightbox. Videos are not supported here.
  • img tag
    This choice will output a simple img tag with a 100% width style setting. Videos are supported.

Note: if you change anything in Basic settings -> Photos -> II: Shortcode [photo ... ] specifications afterwards, the changes will not be reflected in existing posts when an alternative code is selected during the creation of a post.


Shortcode [photo ...] settings