To get familiar with wppa shortcodes: first try the shortcode generator: (this example is in the classic editor, the block editor has the icons in the Add block menu
Not every possible shortcode option is covered by the shortcode generator. This page documents all available shortcode attributes and options.
The basic shortcode for the insertion of a wppa+ display in a page or post is:
The shortcode allows attributes that specify the type of wppa+ display as well as the specification of albums, photos or special selection of photos.
The basic structure is:
[wppa attr1="value1" attr2="value2" ...] The sequence order of attributes is irrelevant.
Important note: Make sure you do not accidently create the shortcode by a copy from an example text or an email. The double quotes might be "texturized" i.e. opening and closing quotes in stead of simple double quotes. This will result in unwanted behaviour!
|type||The type of the display||Default: generic, see the table of types|
|album||The album spicification||See the table of album specifications|
|photo||The photo specification||See the table of photo specifications|
|size||The width (if not the default)||Examples:
|align||The horizontal alignment||Can be one out of left, center, right. Example:
Note: Omission of this argument is not the same as align="left". align="left" adds 'clear:left;float:left;margin-right:10px;' to the container style.
|taglist||Tags to use||Used in:
|cols||Number of columns||Used in:
|sub||Enable subsearch||Used in:
Equivalent to the corresponding widget option
|root||Enable rootsearch||Used in:
Equivalent to the corresponding widget option
|calendar||Specify calendar type||Used in:
Possible options: 'exifdtm', 'timestamp', 'modified', 'realexifdtm', 'realtimestamp', 'realmodified'.
|all||Specifies that all days are initially opened||Used in:
Use of this option is strongly discouraged!
|reverse||Specifies 'last day first'||Used in:
|landing||Specifies search landing page||Used in:
|admin||Specifies 'admins choice' users||Used in:
||parent||To indicate a parent album||Used in:
Only album 13 and its (grand)children will be displayed in the upload album selection box, as far as the user has the rights to upload to these albums.
Prints the total number of (grand)childalbums of album number 13.
Prints the total number of photos in all (grand)childalbums of album number 13.
Note that the parent album can only be a single album id number.
|alt||A photo if the shortcode can not be displayed||The alt attrinute may conatin an existing photo id number. In case the shortcode can not be rendered, you will see the 'placeholder' [WPPA+ Photo display (fsh)].
In some circumstances this is not due to a configuration issue, but you can e.g. have plugin AMP installed and AMP applies to the content.
When the alt attribute is added to the shortcode, a plain photo will be displayed. If you do not want anything to be displayed (no photo and no errormessage) set the alt attribute to none:
|generic||The default shortcode type||This is the default type and generates a generic albums display: a list of album covers that have their parent set to ---none---, or the display as requested by the querystring that calls for the page involved.
|landing||Indicates a 'landing' area||Same as generic, except that it only displays that what is requested in the querystring. Typically used on a landing page where the display occurs as a result of links from widgets.
|cover||Displays one ore more album covers||The requested display type is the cover of an album. The album must be specified in the album attrubute.
|Shows the content of an album||album and content are aliases. Displays sub-album covers and thumbnail images of photos in the album as specified in the album attribute.
If the album contains both photos and sub-albums, the sub-album covers are displayed first. If you want the thumbnails to be shown first, tick the box in Table IV-A20: Thumbs first
|thumbs||Shows thumbnails||Displays thumbnail images of photos in the album as specified in the album attribute.
|covers||Shows sub-album covers||Displays sub-album covers in the album as specified in the album attribute.
|slide||Slideshow||Displays a slideshow of the photos in the album as specified in the album attribute.|
|slideonly||Simple slideshow||A slideshow without supporting navigation boxes.|
|slideonlyf||Simple slideshow with filmstrip||A slideshow with the filmstrip only.|
|filmonly||A slideshow filmstrip only||Example:
|photo||A bare photo||A single photo as specified by the photo attibute.|
|mphoto||A wp-media type like photo||A single photo displayed with the wp caption.|
|xphoto||An extended wp-media type like photo||A single photo displayed with an extended caption.
The extension can be: The rating when enabled in II-B7, The share buttons when enabled in II-C1 and/or The commentform when enabled in II-B10
|slphoto||Single photo slide||A single photo in the style of a slideshow, but without navigations.|
|The following type specifications produce wppa+ supporting boxes rather than photo displays:|
|upload||User upload box||Creates a frontend upload box like the upload widget. An album spec can be given to restrict the uploads to the supplied album(s). If the visitor has no rights to upload here, the box will not be displayed.|
|multitag||Creates a multitag selection box like the tags filter widget. An optional taglist spec can be given to restrict the tags shown, a cols spec to specify the number of columns. Example: [wppa type="multitag" taglist="Bird,Duck,Owl" cols="3"]|
|tagcloud||Creates a tagcloud box like the tagcloud widget. An optional taglist spec can be given to restrict the tags shown. Example:
|superview||Creates a box with content like the superview widget.|
|search||Creates a box with content like the search widget. Optional arguments:
|Miscellaneous type specifications:|
|url||An image url||Returns the url of a specified photo id. Examples:
Example use in template (php):
This is equivalent to
but you can use
Example use in page content:
In real life:
Note the single quotes in the src attribute of img.
In real life: Nice photo
|acount||Prints the number of albums||Examples:
Note that album and parent can only be a single album id number here.
|pcount||Prints the number of photos||Examples:
Note that album and parent can only be a single album id number here.
|share||Shows the share box for the page/post||Example:
|version||Shows the version of wppa you run||Example:
|lastupdate||Shows the date of last upload in an album or systemwide when the album spec is omitted||Example:
|Physical album specifications:|
|13||Album id||The id of the album to be used for the type of display requested by the type attribute.|
|22.214.171.124||Emumeration||An emumeration of album id's like 126.96.36.199|
|34..38||A range||A range like 34..38. Make sure the first number is less than the second number.|
|188.8.131.52..24.7.58||A combo||Any combination of enumaration(s) and range(s)|
|$albumname||Album name preceeded by a $ sign||The name of the album to be used for the type of display requested by the type attribute. When using qTranslate make sure the name language matches the page language.
This method is discouraged, changing the name of the album will cause the album not being found
|#last||Last album||The most recently added (youngest) album.|
|#last,0,1||Last modified||The most recently modified album. This is most likely the album that has the most recently uploaded photo.|
|#last,p,k||Last modified from parent||The k most recently modified albums with parent album p, where p and k are positive integer numbers. These are most likely the albums that have the most recently uploaded photos. Parent p may also be an album name preceded by a $ sign.|
|#cat,cat1,cat2,cat3||Categories AND||A list of physical albums that have the categories cat1 and cat2 and cat3. Can be used to display album covers or photos in any display type.|
|#cat,cat1;cat2;cat3||Categories OR||A list of physical albums that have the categories cat1 or cat2 or cat3. Can be used to display album covers or photos in any display type.|
|Virtual album specifications:|
|#topten[,n[,m[,medals]]]||A virtual album containing the highest rated photos. May optionally include albumnumber (n, 0 for systemwide) and number of photos(m), use 0 for the default as defined in the Settings admin page; add 3rd attribute medals to display only top photos with medals. You can select the way the top photos are defined - bhy mean rating, rating count or view count - in Table IV-E17.
|#lasten[,n[,m]]||Recent||A virtual album containing the most recently uploaded photos. May optionally include albumnumber (n, 0 for systemwide) and number of photos(m) if not the default as defined in the Settings admin page.|
|#comten[,n[,m]]||Commented||A virtual album containing the most recently commented photos. May optionally include albumnumber (n, 0 for systemwide) and number of photos(m) if not the default as defined in the Settings admin page.|
|#featen[,n[,m]]||Featured||A virtual album containing a random choice of featured photos. May optionally include albumnumber (n, 0 for systemwide) and number of photos(m) if not the default as defined in the Settings admin page.|
|#tags,tag1,tag2,tagn||Tagged AND||A virtual album containing photos that are tagged with tag1 and tag2 and tagn.|
|#tags,tag1;tag2;tagn||Tagged OR||A virtual album containing photos that are tagged with tag1 or tag2 or tagn.|
|#all||All||A virtual album containing all photos in the system.|
|#related[,tags|,desc[,nn]]||A virtual album containing photos that are related to the content of the page/post. Specification: tags (default) or desc, and optional maximum number of photos to find ( nn ). If tags is specified, wppa+ searches photos that have tag(s) equal to word(s) in the text of the page/post. If desc is specified, the description of the photos is searched for words matching words in the page/post.
|#owner,username[,parent]||A virtual album containing all albums owned by username. If parent is specified, only the sub-albums of that parent will be selected, if parent is omitted, only top-level albums owned by username. This shortcode may show album covers (type="cover") or photos (type="album"). If username is #me, the currently logged in user is assumed. Parent album may also be an album name preceeded by a $ sign or an enumeration of album numbers (e.g. 3.5.7..11).
|#upldr,username[,parent]||A virtual album containing all photos uploaded by username. If parent is specified, only the photos uploaded by the user out of the parent albums(s) and their sub-albums are shown. If username is #me, the currently logged in user is assumed. Parent album may also be an album name preceeded by a $ sign or an enumeration of album numbers (e.g. 3.5.7..11).
|4711||A number||The id of the photo to be displayed|
|$photoname||The photo name preceeded by a $ sign||The name of the photo to be displayed. When using qTranslate make sure the name language matches the page language.|
|#last||Last photo||The most recently added photo|
|#potd||Photo of the day||The photo of the day as defined by the settings on the Photo ALbums -> Photo of the day admin page|
Remark: If the type of display is set to a slideshow type, you can supply both an album and a photo. In this case the slideshow will start at the specified photo. The photo must be in the album, and the slideshow should be set to start still at first for this to have effect.