Views Shortcodes

WooCommerce Views

wpv-woo-buy-or-select

Since v2.0

description:

Output ‘add to cart’ button for the product listing page

For variable products the ‘select options’ button will be displayed.

For ‘normal’ products, an add to cart button will be displayed. Clicking this will add the product to cart (ajax no page refresh). Once added, a visual indicator will appear next to the button along with a link to view the cart.

For variable products, the user first has to select a product variation, the ‘Select options’ button will take the user to the product detail page, where they can select a Variant and add it to the cart.

Product listings

context:

product listing
attributes:
  • link_to_product_text (opt): 'Button text for Variable products'

    Default text ‘Select options‘ – applies to Variable products
shortcode example:

[wpv-woo-buy-or-select add_to_cart_text=’Add to basket’ link_to_product_text=’More details’]

wpv-woo-product-price

Since v2.0

description:

Output the product price.

For variable products the ‘select options’ button will be displayed

context:

product detail and product listing
attributes:
This shortcode has no attributes
shortcode example:

For normal product the price will be displayed

For on-sale products, the old price and new price will be displayed

For variable products, the lowest price for a Variation will be displayed, preceded by the text “From”

wpv-woo-buy-options

Since v2.0

description:

Output ‘add to cart’ button on product detail pages.

For variable products, the user will be presented with a drop-down of Variations to select from.

context:

product detail
attributes:
  • add_to_cart_text (opt): 'Button text for add to cart'

    Default text “Add to cart

wpv-woo-product-image

Since v2.0

description:

Displays the product image (featured image), wrapped in a link to the full size image.

For variable products, the featured image will be displayed, unless a default variation is set. If a product variation is selected the variation image will be displayed if set, if not, then the featured image will be displayed

If no featured image is set, the WooCommerce place-holder image will be displayed.

Tip: Some themes will automatically display featured image in the product page. As a result; if you are using [wpv-woo-product-image] shortcode in a product Content Template, it will appear duplicated.

In the Toolset Bootstrap theme you can disable post thumbnail display in theme options.

context:

product detail and product listing
attributes:
  • size (opt): 'thumbnail' | 'medium' | 'large'' | 'full' | 'shop_single' (default) | 'shop_catalog' | 'shop_thumbnail' | 'custom image size'

    shop_single, shop_catalog and shop_thumbnail sizes can be set in WooCommerce -> Settings -> Catalog -> Image Options
  • output (opt): 'raw' | 'img_tag'

    By default the image will be wrapped in a link to the full-size version

    output=’raw’ image tag will be output NOT wrapped in a link

    output=’img_tag’ image url for the image will be output

    Read more about custom image sizes in WordPress

shortcode example:

[wpv-woo-product-image size=’shop_single’]

wpv-woo-display-tabs

Since v2.0

description:

Displays WooCommerce product tabs. By default this will display product reviews and product attributes.

WooCommerce product tabs replaces post/page comments with Product reviews – you’ll want to disable the comment section on your product page if it is enabled.

Context: Product detail page

context:

product detail
attributes:
This shortcode has no attributes

wpv-add-to-cart-message

Since v2.0

description:

Displays a success message when a Product is added to the cart. Or exception messages, for example – if there is insufficient stock.

You will want to add this to your product detail page and your product listing pages

context:

product detail and product listing
attributes:
This shortcode has no attributes

General info

wpv-bloginfo

description:

Displays information about your site, mostly gathered from the information you supply in your User Profile and General Settings WordPress Administration Screens.

The Views shortcode just wraps the functionality of the WordPress bloginfo function

context:

inside the view loop or content template
attributes:
shortcode example:
[wpv-bloginfo show="url"]

Will display the URL for your site.

wpv-current-user

description:

Outputs information about the current logged in user.

context:

inside the view loop or content template
attributes:
  • info (opt): 'display_name' (default) | 'login' | 'firstname' | 'lastname' | 'email' | 'id' | 'logged_in' | 'role'

    ‘logged_in’ will return the value ‘true’ or ‘false’. Find out more about user fields.
shortcode example:
[wpv-current-user info="lastname"]

wpv-taxonomy-archive

Since v1.4

description:

Displays information for the current taxonomy (only for taxonomy queries).

context:

inside a taxonomy WordPress archive
attributes:
  • info (opt): 'name' (default) | 'slug' | 'description' | 'id' | 'taxonomy' | 'parent' | 'count'

    When querying a term archive, info=’taxonomy’ will ouput the taxonomy name that the term belongs to.
shortcode example:

Archive for [wpv-taxonomy-archive info=”name”]

wpv-search-term

description:

This shortcode displays the search term when visiting the search results page, mainly if it is controlled using a WordPress Archive created in Views.

context:

layout meta HTML (not in loop)
attributes:
  • param (opt): 'URL parameter'

    the URL parameter used to post the actual search value, defaults to the one used by WordPress (‘s’)
shortcode example:

You are searching for [wpv-search-term]

Pagination controls

wpv-pagination

description:

Display the pagination controls that are within the shortcode. The pagination controls will only be displayed if there are multiple pages to display

context:

filter meta HTML
attributes:
This shortcode has no attributes

wpv-pager-num-page

description:

Outputs the number of pages found by the Views Query

context:

filter meta HTML
attributes:
This shortcode has no attributes

wpv-pager-prev-page

description:

Display a “Previous” link to move to the previous page.

context:

filter meta HTML
attributes:
This shortcode has no attributes
shortcode example:
[wpv-pager-prev-page]Previous[/wpv-pager-prev-page]

wpv-pager-next-page

description:

Displays a “Next” link to move to the next page.

context:

filter meta HTML
attributes:
This shortcode has no attributes
shortcode example:
[wpv-pager-next-page]Next[/wpv-pager-next-page]

wpv-pager-current-page

description:

Display the current page number. It can be displayed as a number or as a drop-down list to select another page.

context:

filter meta HTML
attributes:
  • style: 'drop_down' (display page number in a dropdown) | 'link' (displays a link icon for each page)

    By default linked page numbers will be displayed.
shortcode example:
[wpv-pager-current-page style='drop_down']

Controlling output

wpv-filter-end

description:

The [wpv-filter-start] and [wpv-filter-end] wrap the filter controls meta HTML. All pagination and parametric search filters need to be wrapped in these two shortcodes. Views will add these shortcode automatically to the Views Filter Meta HTML.

context:

filter meta HTML
attributes:
This shortcode has no attributes

wpv-items-found

description:

Meta HTML wrapped in [wpv-items-found][/wpv-items-found] will be output if there are any posts | taxonomies | users returned by the View.

This shortcode replaces [wpv-posts-found][/wpv-posts-found] deprecated in Views 1.4.

These shortcodes are added automatically to the Layout Meta HTML when you create a View.

context:

layout meta HTML (not in loop)
attributes:
This shortcode has no attributes
shortcode example:

[wpv-items-found]Meta HTML displayed when records are found by the View[/wpv-items-found]

wpv-no-items-found

description:

Content wrapped in [wpv-no-items-found][/wpv-no-items-found] will be output if there are any posts | taxonomies | users returned by the View.

This shortcode replaces [wpv-no-posts-found][/wpv-no-posts-found] deprecated in Views 1.4.

These shortcodes are added automatically to the Layout Meta HTML when you create a View.

context:

layout meta HTML (not in loop)
attributes:
This shortcode has no attributes
shortcode example:
[wpv-no-items-found]No users found for this view[/wpv-no-items-found]

wpv-for-each

description:

Iterate through multiple items in a post meta field and output the enclosed text for each item. Including Types repeating fields.

Note: wpv-if shortcode won’t work inside a wpv-for-each shortcode

context:

inside the view loop or content template
attributes:
  • field: 'custom field name'

  • start (opt): 'number'

    start=”2″ will start the wpv-for-each loop on the second element
  • end (opt): 'number'

    end=”3″ will end the wpv-for-each loop on the third element
shortcode example:
Output a repeating types field values as an ordered list

    [wpv-for-each field="wpcf-my-field"]
  1. [types field="my-field"][/types]
  2. [/wpv-for-each]
Output custom field values as an ordered list

    [wpv-for-each field="my-field"]
  1. [wpv-post-field name="my-field"]
  2. [/wpv-for-each]

wpv-if

Modified v1.4

description:

Conditional shortcode to be used to display a specific block of meta HTML based on results of a boolean expression . If the expression is true, then the meta HTML between the [wpv-if][/wpv-if] shortcodes will be executed.

Supported actions and symbols:
Integer and floating-point numbers
Math operators: +, -, *, /
Comparison operators: <, >, =, <=, >=, !=
Boolean operators: AND, OR, NOT
Nested expressions – several levels of parentheses
Variables defined as shortcode parameters starting with a dollar sign
empty() function that checks for empty or non-existing fields
Custom functions and class methods

context:

inside the view loop or content template
attributes:
  • evaluate: The expression to be tested

    If evaluate results in boolean true, then the [wpv-if] will be executed. This can be changed to false if the condition attribute is set.
  • condition (opt): 'true' (default) | 'false'

    If condition=’false’, the [wpv-if] will be executed if the result of the evaluate is false.
  • debug (opt): true

    Will output debug information for your [wpv-if] statement.
shortcode example:
[wpv-if evaluate="boolean condition"]Execute code for true[/wpv-if]

Single variable and comparing its value to a constant

[wpv-if f1="wpcf-condnum1" evaluate="$f1 = 1" debug="true"]Number1=1[/wpv-if]

Two numeric variables in a mathematical expression with boolean operators

[wpv-if f1="wpcf-condnum1" f2="wpcf-condnum2" evaluate="(2 < 3 AND (((3+$f2)/2) > 3 OR NOT($f1 > 3)))" debug="true"]Visible block[/wpv-if]

Compare custom field with a value

[wpv-if f1="wpcf-condstr1" evaluate="$f1 = 'My text'" debug="true"]Text1='My text' [/wpv-if]

Display condition if evaluates to false (use instead of else-if)

[wpv-if condition="false" evaluate="2 > 3"] 2 > 3 [/wpv-if]

Evaluating results of a class method:

[wpv-if evaluate="ClassName::method(something) = 'otherthing'"]true[/wpv-if]

Evaluating results of a custom function:

[wpv-if evaluate="has_term('Test', 'post_tag', null) = '1'"]Tagged Test[/wpv-if]

Read more about Conditional HTML output in your views.

wpv-heading

description:

Creates a sortable header field for a table.

If you use the table layout wizard in Views, you can select to add sortable headers to the table.

Read more about the Layout Wizard Table Layout.

context:

inside the view loop or content template
attributes:
  • name: 'name of the field to be sorted'

    For post fields, this is the shortcode without the wpv- prefix. To sort by [wpv-post-title], name=”post-title”. For types field, the field name must be prefixed with types-field. So, to sort by the types field ‘property-name’, name=”types-field-property-name”.
shortcode example:
[wpv-heading name="post-title"]Title[/wpv-heading]col2col3
[wpv-post-title]col2col3

Will display a table which is sortable by the first column, post title. The column header, can be clicked to sort ascending or descending.

wpv-loop

description:

In a View, the code contained between the <wpv-loop></wpv-loop> will be executed once for every post output for the view.

If you use the wrap or pad attributes, you can control the loop output with the [wpv-item] shortcode.

Note: Unlike all other Views shortcodes, wpv-loop is wrapped in <> and not [].

Find out more about the loop and attributes available within the loop.

context:

layout meta HTML (not in loop)
attributes:
  • wrap (opt): 'number of items in group'

    Tells Views that we are going to process the posts from our view query, in groups. Posts are still processed one by one, but Views now ‘knows’ that we have a logical grouping of posts
  • pad (opt): 'true' | 'false' (default)

    Enforces the grouping specified in the wrap attribute. If pad=true then the number of times the loop runs will always be multiples of the number specified in the wrap attribute.
shortcode example:

wpv-item

description:

Used in the loop. Sets a condition to be met for subsequent lines in the loop to be executed.
If the condition is true, the all subsequent lines will be executed until the next wpv-item shortcode encountered, or the end of the loop.

context:

inside the view loop
attributes:
  • index: number of the post | other | pad | pad-last

    index=1 will target the first record output by the loop. index=other will target all records that do not have a specific index set. index=pad will be executed if there are no records left to output, but the number of records is not a multiple of the loop wrap value. index=pad-last will be executed for the last item in the loop if are no records left to output, but the number of records is not a multiple of the loop wrap value.
shortcode example:

	[wpv-item index=1]
	  Meta HTML to be output for the first item returned by the loop
	[wpv-item index=2]
	  Meta HTML to be output for the second item returned by the loop	  
	[wpv-item index=other]
	  Meta HTML to be output all other items returned by the loop	 
 

wpv-layout-start

description:

Specifies where a Views layout begins and (wpv-layout-end) ends.

These shortcodes are used by the view admin screen when you select or change the view layout using the layout style dropdown. Layout start and Layout end do not output any HTML. They are used to indicate when the View loop starts and ends, so that it can be updated easily.

context:

layout meta HTML (not in loop)
attributes:
This shortcode has no attributes

wpv-layout-end

description:

Specifies where a Views layout begins [wpv-layout-start] and ends.

These shortcodes are used by the view admin screen when you select or change the view layout using the layout style dropdown. Layout start and Layout end do not output any HTML. They are used to indicate when the View loop starts and ends, so that it can be updated easily.

context:

layout meta HTML (not in loop)
attributes:
This shortcode has no attributes

wpv-filter-meta-html

description:

Outputs the pagination and parametric search html for your View. This shortcode along with [wpv-layout-meta-html] is in the Combined Output meta HTML section of your View.
If you delete this shortcode from the Combined Output meta HTML for your View, no markup will be output for the filter section.

context:

combined ouput meta HTML
attributes:
This shortcode has no attributes
shortcode example:
To display pagination above and below your view results, you can repeat the [wpv-filter-meta-html] shortcode:

[wpv-filter-meta-html]
[wpv-layout-meta-html]
[wpv-filter-meta-html]

wpv-layout-meta-html

description:

This shortcode outputs all view results and meta HTML. This is located in the Combined Output section of your View

context:

combined ouput meta HTML
attributes:
This shortcode has no attributes

wpv-filter-start

description:

The [wpv-filter-start] and [wpv-filter-end] wrap the filter controls meta HTML. All pagination and parametric search filters need to be wrapped in these two shortcodes. Views will add these shortcode automatically to the Views Filter Meta HTML.

context:

filter meta HTML
attributes:
  • hide: 'true' | 'false' (default)

    Will not be hidden by default
shortcode example:
[wpv-filter-start hide="true"]

Displaying content

wpv-view

description:

Will render the view on your page, post or in another view or Content template.

You can add custom attributes to the shortcode to pass your own arguments to the view.

context:

page, view loop, custom post type
attributes:
  • name: 'name of the view to be displayed' | 'slug of the view to be displayed'

    It is recommended to use view name rather than view slug.
shortcode example:
[wpv-view name="My amazing custom post list"]

Displaying data

wpv-post-type

description:

Outputs the post plural name, singular name and slug.

context:

inside the view loop or content template
attributes:
shortcode example:
[wpv-post-type show="single"]

wpv-items-count

Since v1.3.1

description:

Outputs the number of posts, users or taxonomies that will be displayed on the page. When using pagination, this value will be limited by the page size and the number of remaining results.

(Compare with [wpv-found-count] – this will output the total number of post returned by the Views query)

This shortcode replaces [wpv-post-count] deprecated in Views V1.3.1.

context:

layout meta HTML (not in loop)
attributes:
This shortcode has no attributes
shortcode example:

Showing [wpv-items-count] posts of [wpv-found-count] posts found.

wpv-post-id

description:

Outputs the ID for the current post

context:

inside the view loop or content template
attributes:
shortcode example:

ID is [wpv-post-id]

wpv-post-slug

Since v1.4

description:

Outputs the slug for the current post

context:

inside the view loop or content template
attributes:
shortcode example:

The slug is [wpv-post-slug]

wpv-post-title

description:

Output’s the current post’s title.

context:

inside the view loop or content template
attributes:
  • id (opt): '$parent' | 'post-id' | '$custom post name'

  • output (opt): 'raw' | 'sanitize'

    output=”sanitize” will let you use the post title as HTML atrributes
shortcode example:

[wpv-post-title]

wpv-post-link

description:

Outputs the current post’s title as a link to the post

context:

inside the view loop or content template
attributes:
shortcode example:

Permalink to [wpv-post-link]

wpv-post-body

description:

Outputs the content of the current post or renders a content template

context:

inside the view loop or content template
attributes:
  • view_template: 'content template name' | 'content template slug' | 'None'

  • suppress_filters (opt): 'true' | 'false' (default)

    If suppress_filters=’true’, all third party (non WordPress) filters hooked into the_content filter will be removed, when retrieving the post body. In certain circumstances, plugins using this filter can add duplicated content to the post body – removing the filters can resolve this problem.
  • id (opt): '$parent' | 'post-id' | '$custom post name'

  • output (opt): 'normal' | 'raw' | 'inherit'

    sets if the post body coming from a [wpv-post-body view_template=”None”] shortcode should add formatting (normal), disable formatting (raw) or inherit it from the parent Content Template (inherit)
shortcode example:
[wpv-post-body view_template="None"]

wpv-post-excerpt

description:

Display the excerpt of the current post

context:

inside the view loop or content template
attributes:
  • length (opt): 'Number of characters or words to be displayed'

    default length is 252 characters or the excerpt length defined by the theme. Since v1.5.1 this length parameter is applied to manual excerpts too.
  • id (opt): '$parent' | 'post-id' | '$custom post name'

  • count (opt): 'char' | 'word'

    sets if the length attribute is to be applied on characters or words.
  • more (opt): 'Text to be displayed'

    sets the text to be used when the excerpt is being trimmed and defaults to ‘…’ or the value set by the theme.
shortcode example:
[wpv-post-excerpt length="30" count="word" more=" - ..."]

wpv-post-status

Since v1.4

description:

Display the current post status one of the following:
Published, Future, Draft, Pending, Private, Trash, Auto-Draft, Inherit

context:

inside the view loop or content template
attributes:
shortcode example:
This post has a status of [wpv-post-status]

wpv-post-featured-image

Modified v1.4

description:

Outputs the featured image for the current post.

If the data attribute is set, just the value for the data item will be returned, not the image.

context:

inside the view loop or content template
attributes:
  • size (opt): 'thumbnail' (default) | 'medium' | 'large' | 'full' | 'custom image size'

    Custom image sizes must be defined using add_image_size
  • data (opt): 'id' | 'author' | 'date' | 'description' | 'title' | 'caption' | 'original' | 'alt'

    Display additional information for the image
  • raw (opt): 'true' | 'false' (default)

    If true, the image url will be returned instead of the image HTML tag.
  • id (opt): '$parent' | 'post-id' | '$custom post name'

  • attr (opt): 'query-string-like value'

    Will only work when displaying the full img HTML tag and expects a query-string-like value: attr=”title=a&alt=b&classname=c” will add those attributes to the img HTML tag
shortcode example:

[wpv-post-featured-image size=”medium” raw=”false”]

wpv-post-field

description:

Output a custom field for the current post.

This displays the raw data from the field. Use the Types plugin the and the [types] shortcode to display formatted fields.

context:

inside the view loop or content template
attributes:
  • name: 'field name'

    The name of the custom field to display (including wpcf- prefix)
  • index (opt): 'zero based array index'

    The array index to use if the meta key has multiple values. If index is not set then all values will be output
  • separator (opt): 'string separator for multiple values'

    Default value is comma followed by a space
  • id (opt): '$parent' | 'post-id' | '$custom post name'

shortcode example:

[wpv-post-field name=”wpcf-my-types-custom-field”]

wpv-post-comments-number

description:

Displays the number of comments for the current post

context:

inside the view loop or content template
attributes:
  • none: ' Text if there are no comments'

    Default – “No Comments”
  • one: 'Text if there is only one comment.'

    Default – “1 Comment”
  • more: 'Text if there is more than one comment'

    Default “% Comments”
  • id (opt): '$parent' | 'post-id' | '$custom post name'

shortcode example:
[This post has [wpv-post-comments-number none='No Comments' one='1 Comment' more='% Comments']

wpv-taxonomy-title

description:

Outputs the taxonomy title as a plain text

context:

inside a taxonomy view loop
attributes:
This shortcode has no attributes
shortcode example:
[wpv-taxonomy-title]

wpv-taxonomy-slug

description:

Outputs the taxonomy slug

context:

inside a taxonomy view loop
attributes:
This shortcode has no attributes
shortcode example:
[wpv-taxonomy-slug]

wpv-taxonomy-url

description:

Display the taxonomy URL as a plain text (not embedded in a HTML link)

context:

inside a taxonomy view loop
attributes:
This shortcode has no attributes
shortcode example:
[wpv-taxonomy-url]

wpv-taxonomy-description

description:

Outputs the taxonomy description text

context:

inside a taxonomy view loop
attributes:
This shortcode has no attributes
shortcode example:
[wpv-taxonomy-description]

wpv-taxonomy-post-count

description:

Output the number of posts for the current taxonomy

context:

inside a taxonomy view loop
attributes:
This shortcode has no attributes
shortcode example:
[wpv-taxonomy-post-count]

wpv-post-taxonomy

description:

Output the taxonomy for the current post.

context:

inside the view loop or content template
attributes:
  • separator (opt): 'string separator for multiple values'

    Default value is comma followed by a space
  • type: 'name of the taxonomy to be displayed'

  • format (opt): 'link' (default) | 'text' | 'url'

  • show (opt): 'name' (default) | 'description' | 'slug' | 'count'

  • order (opt): 'asc' (default) | 'desc'

  • id (opt): '$parent' | 'post-id' | '$custom post name'

shortcode example:

Filed under [wpv-post-taxonomy type=”category” separator=”, ” format=”link” show=”name” order=”asc”]

wpv-post-url

description:

Outputs the URL to the current post.

context:

inside the view loop or content template
attributes:
shortcode example:
link to the current post

wpv-post-author

description:

Display details for the author of the current post.

context:

inside the view loop or content template
attributes:
shortcode example:
Post author likes to be known as [wpv-post-author format="meta" meta="nickname"]

wpv-user

Since v1.4

description:

Display user info in a Views user query. Will display user information for the current user found in loop.

context:

inside a user view loop
attributes:
  • field (opt): 'display_name' (default) | 'ID' | 'user_login' | 'user_firstname' | 'user_lastname' | 'nickname' | 'user_email' | 'user_url' | 'user_registered' | 'user_status' | 'spam' | 'custom user field name'

    Custom field name takes the full field slug e.g field=’wpcf-custom-user-field’ Find out more about user fields.
shortcode example:
[wpv-user field="description"]

Display bio for user returned by Views loop

[wpv-user field="wpcf-custom-user-field"]

Display a custom user field added by Types

wpv-post-date

Modified v1.5

description:

Outputs the post date for the current post. If format is not set, this will default to the date format set in WordPress general settings.

context:

inside the view loop or content template
attributes:
shortcode example:
Published on [wpv-post-date format="F jS, Y"]

wpv-post-edit-link

description:

Displays an edit link to the current post.

context:

inside the view loop or content template
attributes:
  • label (opt): 'Button text'

    Set the text for the link. Default ‘Edit this’, the label value will be appended after ‘Edit’. So label=’my post’ will result in a link text of Edit my post
  • id (opt): '$parent' | 'post-id' | '$custom post name'

shortcode example:
[wpv-post-edit-link label='post name']

wpv-found-count

description:

Displays the total number of posts, users or taxonomies that have been found by the Views query. This value is calculated before pagination, so even if you are using pagination, it will return the total number of posts matching the query.

Compare with [wpv-items-count] which will output the number of records on the page.

context:

layout meta HTML (not in loop)
attributes:
This shortcode has no attributes
shortcode example:

Showing [wpv-items-count] posts of [wpv-found-count] posts found.

wpv-post-class

Since v1.5.1

description:

Displays the CSS classnames related to the current post.

context:

inside the view loop or content template
attributes:
  • add (opt): 'Space separated list of classnames to be added'

shortcode example:

Filter controls

wpv-filter-controls

description:

This shortcode contains all the controls and display elements for a parametric search form. All parametric search controls must be wrapped in the [wpv-filter-controls][/wpv-filter-controls] shortcode.

context:

filter meta HTML
attributes:
  • hide: 'true' | 'false' (default)

    Will not be hidden by default
shortcode example:
[wpv-filter-controls hide='true']

For more information about filter controls, Parametric search – Letting Visitors Filter Content

wpv-filter-submit

Modified v1.4

description:

Adds a submit button to a Parametric search form.

context:

filter meta HTML
attributes:
  • name: 'button text'

  • class: class name separated by a space

    class takes a string value and will be added unchanged to the html element
  • hide: 'true' | 'false' (default)

    Will not be hidden by default
shortcode example:

[wpv-filter-submit name=”Search” class=”my-button”]

wpv-control

Modified v1.5

description:

This shortcode will output filter controls for your parametric searches.

When you add filter controls in your Filter Meta HTML, the matching URL parameters will be added to your View Filter.

Parametric search – Letting visitors filter content

context:

filter meta HTML
attributes:
  • field: 'custom field name'

  • url_param: 'URL parameter name'

  • type: 'checkbox' | 'checkboxes' | 'date' | 'datepicker' | 'radios' | 'select' | 'textfield' | 'multi-select'

    optional – control type to be displayed on your Parametric search form. Defaults to the appropriate control type for the field type.
  • values: comma separated list of option values

    optional - for select, multi-select, radios and checkboxes controls. Words in conjunction with the display_values attribute.
  • display_values: comma separated list of option display values

    optional - for select, multi-select, radios and checkboxes controls. Works in conjunction with the values attribute. Number of entries for the display_values attribute must match the number of entries for the values attribute. ‘//’ can be used to force commas in the display values (e.g. 2,3//,1,4) would display option values of 2 and 3,1 and 4
  • auto_fill: 'slug of the field used to populate control options'

    optional – Will populate a select, multi-select, radios, checkboxes will database values for a specific custom field. The filed slug with the wpcf- prefix must be used.
  • auto_fill_default: 'text to be displayed as the default option'

    optional - used to set the default value of the control. If the value is not one of the control values, the value will be placed as the first entry – good for ‘All’ or ‘Select any’ defaults.
  • auto_fill_sort: 'asc' (default) | 'desc' | 'ascnum' | 'descnum' | 'none'

    optional
  • title: 'checkbox title'

    Only applicable to the checkbox control type.
  • taxonomy: 'slug of the taxonomy to be displayed'

    optional – ill display ‘select’ control type by default. Taxonomy can also be displayed as ‘checkboxes’ type.
  • taxonomy_orderby: 'count' | 'id' | 'name' (default) | 'none' | 'slug' | 'term_group'

    optional - set the display order for taxonomy terms.
  • taxonomy_order: ASC (default) | DESC

    optional – Taxonomy display order.
  • format: '%%COUNT%% %%NAME%%'

    optional - %%COUNT% will display the number of post for the taxonomy term and %%NAME%, the taxonomy term. e.g. format=’%%NAME%% (%%COUNT%%)’
  • default_label: 'default option text'

    optional - Add default option like All or Any on taxonomy select control.
  • date_format: 'WordPress date format'

    optional - applicable for a datepicker control – format will default to WordPress General Settings. Use WordPress date formats.
  • default_date: 'any of the Toolset date filters' (default TODAY()) | 'NONE'

  • hide_empty (opt): 'true' | 'false' (default)

    Applies to filtering by Taxonomy. If true, empty taxonomies will not be displayed.

wpv-filter-reset

description:

Adds a clear or reset button to a Parametric search form.

context:

filter meta HTML
attributes:
  • reset_label (opt): 'button text'

  • class (opt): class name separated by a space

    class takes a string value and will be added unchanged to the html element
shortcode example:

[wpv-filter-reset reset_label=”Clear” class=”my-button”]

wpv-filter-spinner

description:

Will display a spinner attached to a container that can be used in custom overlays when automatically updating Views results on a parametric search. Note that this shortcode must be closed.

context:

filter meta HTML
attributes:
  • container (opt): 'span' | 'div' | 'p'

    whether the container is a span, a division or a paragraph
  • class (opt): 'class name separated by a space'

    class takes a string value and will be added unchanged to the html element
  • position (opt): 'before' | 'after' | 'none'

    whether the spinner will be added at the begining or end of the container, or will be hidden
shortcode example:

[wpv-filter-spinner container=”div” class=”myclassname” position=”before”]My content[/wpv-filter-spinner]

wpv-control-set

description:

This shortcode is a wrapper for the [wpv-control-item] shortcodes generated when displaying a parametric search that uses a filter by post relationship.

It has some attributes that hold important data for those inner shortcodes.

Parametric search – Letting visitors filter content

context:

filter meta HTML
attributes:
  • url_param: 'URL parameter name'

  • ancestors: 'post ancestors tree'

    post ancestors that will be displayed in this filter, in a >-separated list

wpv-control-item

description:

This shortcode displays each ancestor input for a parametric search that uses a filter by post relationship.

Parametric search – Letting visitors filter content

context:

filter meta HTML
attributes:
  • type: 'select' | 'multi-select' | 'radios' | 'checkboxes'

  • ancestor_type: 'post type slug'

    ancestor slug that this shortcode will generate the input for
  • default_label (opt): 'default option text'

    adds a default option like All, Any or Select one on a select control.