Archive for June, 2012

Useful info 1

It enables plugin developers to create special kinds of content (e.g. forms, content generators) that users can attach to certain pages by adding the corresponding shortcode into the page text.

The API handles all the tricky parsing, eliminating the need for writing a custom regular expression for each shortcode. Helper functions are included for setting and fetching default attributes. The API supports both self-closing and enclosing shortcodes.

Shortcode text written by providing a handler function. Shortcode handlers are broadly similar to WordPress filters: they accept parameters (attributes) and return a result (the shortcode output).

Shortcode names should be all lowercase and use all letters, but numbers and underscores (not dashes!) should work fine too.

The `add_shortcode()` function is used to register a shortcode handler. It takes two parameters: the shortcode name (the string used in a post body), and the callback function name.

Three parameters are passed to the shortcode callback function. You can choose to use any number of them including none of them.

Top

Useful info 2

Some WordPress Widgets offer customization and options such as forms to fill out, includes or excludes of data and information, optional images, and other customization features.

The Widgets SubPanel explains how to use the varilus Widgets that come delivered with WordPress.

The Widgets page at Automattic explains how to ‘widgetize’ WordPress Themes and Plugins, and how to write WordPress Widgets.

WordPress Widgets and Plugins featuring Widget options can be found in the WordPress Plugin Directory.

  1. Go to Appearance > Widgets.
  2. Choose a Widget and drag it to the sidebar where you wish it to appear. There might be more than one sidebar option, so begin with the first one. Once in place, WordPress automatically updates the Theme.
  3. Preview the site. You should find that the “default” sidebar elements are now gone and only the new addition is visible.
  4. Return to the Widgets Panel to continue adding Widgets.
  5. To arrange the Widgets within the sidebar or Widget area, click and drag it into place.
  6. To customize the Widget features, click the down arrow in the upper right corner to expand the Widget’s interface.
  7. To save the Widget’s customization, click Save.
  8. To remove the Widget, click Remove or Delete.
Top
Page 1 of 1

For more information, please call us on 01727 790800

If you would like to be contacted by email please send this to enquiries@gemmells.co.uk