⚒️ Part 4: Plugins and shortcodes

Shortcodes are also one of the essential functions of WordPress. They are used to embed any custom script or functions on your pages.
Shortcodes are used for things like:

  • Including contact forms on any page
  • Including certain image galleries on any page
  • Incuding WordPress custom menu anywhere on a page
  • Including code blocks

Basic shortcode looks like this:

[gallery id="123" size="medium"]
// This would output a gallery, with an ID value 123, with medium-resolution images

[contact-form-7 id="1234"]
// If you use Contact Form 7 plugin, you can output a contact form with this shortcode

Shortcode excercises:

Install plugin Contact Form 7

This is one of the most popular contact form plugins. With it, you can add create your own contact forms and embed them on your site, so your site visitors could contact you. After installing and activating the plugin, go to Plugins page, and click “Settings” under Contact Form 7.

Tweak the contact form

One contact form is already created for you. You can open it by clicking on “Contact form 1”.
You’ll see, how the contact form has been built up and which fields it already has.
Feel free to tweak some text inside the form, for example replace some words.

Click on the “Mail” tab, and tweak some settings there.
From the “Message body” field, you’ll see how the email will look like which reaches to your inbox.
Feel free to tweak some text inside the form, for example replace some words.

Copy the shortcode to your page
  1. Copy the shortcode, it’s on the blue background in your contact form editing page
  2. Create a new page “Contact”
  3. Add the title and some content. Then paste the shortcode somewhere too.
  4. Visit the page

Result should look like this

Add an image gallery to your site

  1. Create a gallery page
  2. Get a gallery plugin, but try installing it manually this time, from zip file (next step)
  3. Download a plugin .zip file that would output an image gallery, for example plugin called Meow Gallery
  4. Upload the .zip file (Plugins > Add New > Upload plugin)
  5. Install and activate this plugin, and find a way to create an image gallery with it (Meow Apps > Galleries > Galleries & Collections)
  6. Get the shortcode
  7. Insert the shortcode to the Gallery page
  8. Put the Gallery link to your page menu from Appearance > Menus

Result should look like this

Scroll to Top