Displaying Policies

GovernDocs allows policies to be displayed on the front end of your WordPress site using a shortcode placed on a page or post.

Policies are presented on the frontend with document information and links to download the policy.

Field defaults

In the settings of GovernDocs, you can set the default fields to be shown for all policies. These defaults can be overridden on individual items with shortcode attributes.

Displaying a list of all policies

You can show all policies for a certain time period using the below shortcode. The shortcode below will display all policies for March 2026. You can leave off the month attribute to show all policies for 2026.

[governdocs_all
type="policy"
show_toolbar="1"
year="2026"
month="3"
]

Displaying a single policy

When you create a policy a shortcode will be displayed beneath the title.

Simply copy this shortcode and add it to any post, page or area that accepts shortcodes and your policy will be displayed.

Display policy document on frontend using a shortcode

The standard layout includes the policy title, description, download button and document metadata such as document type, size and status. Below is an example of what the policy looks like on the front end.

Shortcode Options

The policy shortcode includes many customization options that controls how your policy appears on the page. Below is an example shortcode showing all attributes.

[governwp_policy
id="123"
show_icon="1"
button="1"
link="file"
desc_location="below_title"
class="custom-policy-card"
fields="ext,size,type,status,version,effective_date,approval_date,review_date,last_reviewed_date,owner,approving_authority,policy_id"
]

Available Attributes

  • id – Displays a specific report by post ID. Example: id="123"
  • show_icon – Controls whether the document icon is shown. Use 1 to show it or 0 to hide it. Example: show_icon="1"
  • button – Controls whether the download button is shown. Use 1 to show it or 0 to hide it. Example: button="1"
  • class – Adds a custom CSS class to the output. Example: class="custom-report-card"
  • fields – Defines which report fields are displayed and in which order. Example: fields="type,report_date,published_date,ext,size,status,owner,report_id"
  • display – Controls the layout style. Available values are card and full. Example: display="card"
  • title – Lets you show, hide, or override the title. Examples: title="Annual Financial Report", title="1", or title="0"

PRO only attributes

The below attributes are available in the PRO version.

  • desc_location – Controls where the description appears relative to the metadata. Available values are above and below. Example: desc_location="above"
  • allowed_roles – Restricts output so only specific user roles can view the policy. Example: allowed_roles="subscriber,customer"
  • blocked_roles – Blocks specific user roles from viewing the policy. Example: blocked_roles="guest"
  • blocked_button_text – Sets the fallback button text when access is blocked. Example: blocked_button_text="Log In to Access"
  • blocked_button_url – Sets the fallback button URL when access is blocked. Example: blocked_button_url="https://example.com/my-account"
  • blocked_button_new_tab – Opens the fallback button link in a new tab. Accepted values include 1, true, yes, and on. Example: blocked_button_new_tab="1"
  • blocked_button_class – Adds custom classes to the fallback button. Example: blocked_button_class="button button-primary"
  • blocked_description – Sets custom text shown when access is blocked. Example: blocked_description="This policy is available to signed-in users only."

Available Policy Fields

The following field keys can be used in the fields attribute:

  • ext – File extension
  • size – File size
  • type – Document type label
  • status – Policy status
  • version – Policy version
  • effective_date – Effective date
  • approval_date – Approval date
  • review_date – Next review date
  • last_reviewed_date – Last reviewed date
  • owner – Policy owner
  • approving_authority – Approving authority
  • policy_id – Internal policy ID