Skip to content
Home » Documentation » Accessible Reading » Shortcodes » Accessible Reading Shortcode: Generate Accessible Content

Accessible Reading Shortcode: Generate Accessible Content

The accessible_reading shortcode allows you to add accessible text with a toggle switch anywhere on your WordPress website. To ensure your shortcode’s accessible content is automatically generated, a user with edit post capabilities must preview the page using the shortcode at least once while you have enough API requests for the day.

To use it, simply wrap the text you want to make accessible with the shortcode while also adding an id attribute. For example:

[accessible_reading id="foo"]This content will generate accessible content![/accessible_reading]

The id attribute is important because this shortcode’s accessible content, once it is generated, is stored as meta data using the id as part of the meta key.

Hide the Toggle Switch Button

This shortcode will also add the toggle switch to enable/disable the accessible content automatically, so if you’re using it in multiple locations and want just one switch, set the hide_toggle attribute to 1 to disable it like this:

[accessible_reading id="bar" hide_toggle"1"]This content will generate accessible content but without showing a toggle![/accessible_reading]

Save to a Specific Post

This shortcode saves its content to the post’s meta data, so if you’re using it in a global area of your website like your header, footer, or sidebar, you should assign the shortcode a post or page ID to save it once to avoid saving it to every post or page it’s visible on like this:

[accessible_reading id="david" post_id="23"]This content will always save and pull its accessible content from post ID 23[/accessible_reading]

Disable (Temporarily)

If you want to temporarily disable the automatic processing without removing the shortcode, you can set the disable attribute to 1 like this:

[accessible_reading id="bowie" disabled="1"]This content won't be accessible, nor will it have a toggle. Yet.[/accessible_reading]

Related Post Module Attributes Before

array(29) {
  ["post_type"]=>
  string(4) "post"
  ["post_id"]=>
  string(1) "0"
  ["exclude"]=>
  string(1) "0"
  ["title"]=>
  string(32) "Related Articles & Tutorials"
  ["description"]=>
  string(0) ""
  ["max"]=>
  string(1) "3"
  ["post_ids"]=>
  string(0) ""
  ["exclude_ids"]=>
  string(0) ""
  ["is_series"]=>
  string(0) ""
  ["featured_term"]=>
  string(0) ""
  ["exclude_terms"]=>
  string(0) ""
  ["exclusive"]=>
  string(1) "1"
  ["order"]=>
  string(4) "DESC"
  ["show_image"]=>
  string(2) "on"
  ["image_size"]=>
  string(6) "medium"
  ["menu_order_label"]=>
  string(0) ""
  ["show_order_label"]=>
  string(2) "on"
  ["show_date"]=>
  string(2) "on"
  ["show_meta_keys"]=>
  string(2) "on"
  ["show_modified"]=>
  string(0) ""
  ["show_author"]=>
  string(0) ""
  ["show_categories"]=>
  string(0) ""
  ["show_primary_category"]=>
  string(0) ""
  ["show_description"]=>
  string(0) ""
  ["show_reading_time"]=>
  string(2) "on"
  ["show_cta"]=>
  string(2) "on"
  ["cta"]=>
  string(9) "Read more"
  ["autoplay"]=>
  string(0) ""
  ["allow_sticky"]=>
  string(0) ""
}

Related Post Module Attributes

array(29) {
  ["post_type"]=>
  string(4) "post"
  ["post_id"]=>
  string(1) "0"
  ["exclude"]=>
  string(1) "0"
  ["title"]=>
  string(32) "Related Articles & Tutorials"
  ["description"]=>
  string(0) ""
  ["max"]=>
  string(1) "3"
  ["post_ids"]=>
  string(0) ""
  ["exclude_ids"]=>
  string(0) ""
  ["is_series"]=>
  string(0) ""
  ["featured_term"]=>
  string(0) ""
  ["exclude_terms"]=>
  string(0) ""
  ["exclusive"]=>
  string(1) "1"
  ["order"]=>
  string(4) "DESC"
  ["show_image"]=>
  string(2) "on"
  ["image_size"]=>
  string(6) "medium"
  ["menu_order_label"]=>
  string(0) ""
  ["show_order_label"]=>
  string(2) "on"
  ["show_date"]=>
  string(2) "on"
  ["show_meta_keys"]=>
  string(2) "on"
  ["show_modified"]=>
  string(0) ""
  ["show_author"]=>
  string(0) ""
  ["show_categories"]=>
  string(0) ""
  ["show_primary_category"]=>
  string(0) ""
  ["show_description"]=>
  string(0) ""
  ["show_reading_time"]=>
  string(2) "on"
  ["show_cta"]=>
  string(2) "on"
  ["cta"]=>
  string(9) "Read more"
  ["autoplay"]=>
  string(0) ""
  ["allow_sticky"]=>
  string(0) ""
}