Add Statistics to Pages

Statistic Posts can be displayed in pages of your site via Shortcode. Add the shortcode to your page using the example code below. If using the block editor (gutenberg) you can insert a Shortcode block and then enter the shortcode below.

The shortcode is also shown in the editor when editing a Statistics post.

Shortcode Parameters:

ids=""

Examples:

  • ids="15"
  • ids="25,54"
  • ids="17,109,36,78,17,12"

The ids parameter controls which Statistics post(s) is displayed. One or more post ids can be passed to the parameter to control which stat posts are shown and their order. At least one post id must be specified. Separate multiple post ids by a comma only. You can find the post id of any stat post by editing the post and looking for the post ID in the address bar on the WordPress admin’s edit screen.

align=""

The align parameter controls the alignment of the component. The following options are supported:

If no option is passed to the align parameter or it is left off the shortcode no alignment will be applied and the component will follow the theme’s styles

left

Aligns the Stats to the left via floats allowing text content to flow around the component.

right

Aligns the Stats to the right via floats allowing text content to flow around the component.

center

Aligns the Stats centered within the content with equal space to each side of the component.

wide

If the Theme supports it and adds styles this alignment option will typically make the stats wider than the content column of the page.

full

If the Theme supports it and adds styles this alignment option will make the stats component the full width of the browser.

theme=""

The theme parameter overrides the visual color theme applied to each stat displayed by the shortcode. The plugin provides two color themes that can be passed: "default" and "dark". If no theme is provided the stat posts displayed will use the theme applied to the post themselves when editing the post. You can use this setting if you wish to display all of the stats in a shortcode instance with the same color scheme. For instance a page design may contain alternating rows of 3 stat posts. If each 3 stat posts are separate shortcode instances you could alternate the coloring of the stat rows by alternating the theme parameter for the entire row. Note: a WordPress theme may extend or modify these theme options, consult the documentation for your WordPress theme for specifics.