Blocks & Shortcodes

Blocks

WP Congress comes built in with many great and useful shortcodes/blocks that can be used to display information from these data sources on any page on your site. 

Using Blocks (available with Gutenberg Editor)

If you are using Gutenberg, there will be a block category named “WP Congress Blocks” available. Adding a block is as simple as clicking the desired block and it’s added to the page. Warning: These blocks/shortcodes were designed to only work with one block (WP Congress Block) on a page.


Legislator Archive

The Legislator Archive shortcode will display a list of all legislators on your site.  You’ll need to configure the pagination for how many legislators to display per page in the Legislators Per Page field (default is 10).

Legislator Honor Roll

The Legislator Honor Roll shortcode will display all legislators with a voting record at or above a certain percentage.  You’ll need to configure what that percent is in the Percent field (default is 90%).

Legislator Map

The Legislator Map shortcode will display a clickable map where a site visitor can click on a state to pull up legislators for that state.  There is no configuration needed for this shortcode.

Legislator Search

The Legislator Search shortcode adds a search bar for users to use to find legislators either by their address or by the Legislator’s last name.  To configure this shortcode, enter in either location (to add a search bar by location) or name (to add a search bar by last name) in the Legislator Search Type field.  

If using the address search, the user will enter their address and then has the option for results to show up in order of location (closest to furthest).  If using the last name search, the user will then have the option to sort them A to Z or Z to A.

Bill Search

The Bill Search shortcode adds a search bar for users to use to find votes based on a certain search criteria.

Shortcodes

If you are using the Classic Editor, the same blocks have equivalent shortcodes available. To add them, go to the page you want to edit.  In the WYSIWYG enter the following shortcodes for the desired functionality you want to add.

Warning: These blocks/shortcodes were designed to only work with one block (WP Congress Block) on a page.


Name

Shortcode

Legislator Archive

[wpc_legislator_archive]

Legislator Honor Roll

[wpc_legislator_honor_roll percent=90]

Legislator Map

[wpc_legislator_map]

Legislator Search

[wpc_legislator_search]

Bill Search

[wpc_bill_search]




Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.