Site Documentation
Shortcodes
Shortcodes are custom pieces of code that allows for special formatting within a post or page. This provides pages and posts to have a consistent layout that would be more challenging with the default editor.
Shortcodes are detected by WordPress with the format of [shortcodeName parameter=””] text [/shortcodeName]. Some shortcodes do not surround the post’s text and would not require the closing brackets.
Below are the shortcodes I have created for Cooking Vacations:
Site-wide Shortcodes:
Image Block-- Formats a block of text with an image to the left side.colorBox-- Places the containing text in a box formatted with one of four colored backgrounds.
- Format: [imgBlock img="" width="" height=""] [/imgBlock]
- Parameters:
- img -- The URL of the image, uploaded into WordPress
- width -- The width of the image
- height -- The height of the image
photoColumn-- Formats a list of images to reside on the left side of either the rightColumn or tourColumn shortcode.
- Format: [colorBox color=""][/colorBox]
- Parameters:
- color -- Choose one of the following colors:
- blue
- green
- yellow
- rose
rightColumn-- Formats the text to the right of the photoColumn.
- Format: [photoColumn] [/photoColumn]
- No Parameters are required.
Format: [rightColumn] [/rightColumn]imgMenu-- Lays out a list of images in a grid format. Can be used for menus (the Recipe Book page for example) or just to lay out a group of images (any of the accomodation posts)
threeColBlock-- This is the wrapper code for a page or post that is laid out in three columns. This requires the following three shortcodes.
- Format: [imgMenu] [/imgMenu]
- No Parameters are required.
Format: [threeColBlock] [/threeColBlock]col-1, col-2, col-3-- These three shortcodes work with the threeColBlock shortcode to format the containing text into a three column format.
Format: [col-1] [/col-1] (change the 1 to 2 and 3 )imgPopup-- Allows an image to popup in a lightbox.
otherPost-- Takes the content from another post and inserts it into this one. Useful to duplicate tours, but keep the title and tour category.
- Format: [imgPopup url="" width="" group=""] Parameters:
- url -- The URL of the image uploaded in WordPress
- width -- The width of the image displayed in the post
- group -- The lightbox will provide previous and next links for a group of images. This parameter will group the images for this function.
- Format: [otherPost post_id = ""]
- Parameter:
- post_id -- The ID of the post you want to take the content from.
Page Specific Codes:
sc-link-- This shortcode was created for the lightbox link effect on the Saint's Calendar. It shouldn't be used for other pages.ItalianBitesBar-- Adds the navigation menu for the Italian Bites Section
- Format: [sc-link title="" content=""width=""]
- Parameters:
- title -- The name of the holiday, with formatting
- content -- The URL of the holiday description page
- width -- The width of the block of text.
Format: [ItalianBitesBar]cvNewsletter-- This will provide the formatting for the newsletter.
- Format: [cvNewsletter section="" title=""][/cvNewsletter]
- Parameter:
- section -- Type in a section name from below.
- intro
- table-talk
- recipes-of-the-month (For this one, use the otherPost shortcode to get the content from the Recipes of the Month post.)
- food-notes
- with-love-from-italy
- italian-feasts
- italy-on-a-plate
- restaurant-of-the-month
- book-of-the-month
- property-of-the-month
- chef-of-the-month
- general
- title -- Type in the title for the section
Tour Specific Codes
tourColumn-- Formats the text to the right of the photoColumn. There are some slight formatting changes for the tours that differ from the rightColumn shortcode.tourDisplay-- Displays the tour categories and associated tours based on the non-regional tour category (seasonal, Renaissance Women, etc).
- Format: [tourColumn] [/tourColumn]
- No Parameters are required.
accomPhotoGal-- Provides the link and formatting for the Accomodation post for a tour.
- Format:[tourDisplaytour_slug=""]
- Parameter:
- tour_slug -- The slugfor the tour category.
ToILink-- Provides the link and formatting for the Tastes of Italia pdf in a tour post.
- Format: [accomPhotoGal url=""]
- Parameter:
- url -- the URL of the accomodation post. It can be the shortlink or the full url of the post.
backTop-- Creates the "Back to Italy Tours & Back to Top" links in a tour post.
- Format: [ToILink url="" date=""]
- Parameter:
- url -- The URL of the pdf uploaded to WordPress
- date -- The month and year of the ToI publication.
Format: [backTop]
The codes below are for the tours, but are specific to the main tour page, and are not to be used on any other page.
tourBar-- This creates the region bar on the main tour page, as well as the tour post.tourSubCatDisplay-- This shortcode is used only on the main tour page. It displays the tour categories and associated tours based on the region. It should not be used on any other page than this one. I'm including this to have a complete document.
- Format: [tourBar region="" text=""]
- Parameters:
- region -- The slug for the region. The associated region imageand map image are based on the slug.
- text -- The description for the region.
- Format: [tourSubCatDisplay top_category = ""]
- Parameter:
- top_category -- The slug for the region.