• Skip to primary navigation
  • Skip to main content

Guide to Using Wordpress

  • Introduction
    • About WordPress
    • Logging In
    • The WordPress Dashboard
    • Pages, Posts and Media
  • Editing
    • Block Editor
    • Classic Editor
    • The Media Library
    • Galleries and Photos
    • Menus and Links
    • Using Tables
    • Contact Forms
  • Advanced
    • Undoing Changes
    • Create a News Page
    • Create an Event
    • Members-Only Content
    • Shortcodes

Shortcodes

Shortcodes are a way of inserting information into a page, or creating a special effect on a page that isn’t part of the standard WordPress feature set. Shortcodes are enclosed in square brackets as [shortcode] and can sometimes have additional parameters passed, e.g. [shortcode colour=”blue”].

Most of the shortcodes used on this site are simple single entities, but it is also possible to have enclosing shortcodes which act as a wrapper round a piece of text. e.g.

[shortcode]Content to be displayed[/shortcode]

Note that the closing shortcode tag has the same name but starts with a / character.

In the WordPress block editor you normally place a shortcode on the page using the shortcode block. However it is also possible to include them as part of the normal page text, which is what you need to do for the dashicon shortcode shown below.

Here is a complete list of shortcodes supported.

[contact]

Used to insert a contact form on your page, as discussed in detail here.

[dashicon]

This is used to insert icons, typically phone or email icons, into your page. These icons are taken from the standard WordPress dashicons set. You can view the full set here. Click on an icon on that page to see its name and use that name without the dashicons- prefix.

[dashicon id="phone"] 01217 123456
[dashicon id="email"] info@example.com

01217 123456
info@example.com

[responsive-iframe]

This is typically used to display a location map created by Google, although it can also be used for things like Google calendars. The Google embed codes are quite complex, so to avoid the danger of the text being changed inadvertently they are now defined separately in the Settings section (admin only at present) and you only need to use this shortcode to reference them.

The location map for your venue is normally shown using the code

[responsive-iframe id=1 height=400]

Up to 4 different content frames can be defined, id=1 is normally used for the venue map. The content takes the full available width on the page, but you can set the height in pixels.

[table]

This inserts a table created using TablePress. You need to specify which table to insert using the table ID. It is usually easier to do this using the TablePress button in the page editor. Find out more on the Using Tables page.

« Members-Only Content Up

Copyright © 2022 ยท Skirrid Systems