Dynamic Injection
Last updated
Was this helpful?
Last updated
Was this helpful?
The value field in the Meta Filter supports dynamic injection. This means you donβt need to use only static values, but have the option to also define page id/field and datetime aliases. These aliases will be replaced dynamically with the current value depending on the page and/or current date and time respectively.
Example usage: find all posts where post_object/relationship field contains the current page in the list.
To compare with a field value, you can use $post$.field-name
, where 'field-name' should be replaced with the name of your target field. In this way, the plugin will automatically get and use a value of the field from the current page in the query.
Example usage: find all posts where a 'select' field has the same option chosen, as the option chosen on the current page.
To compare with a query ($_GET) value, you can use $query$.field-name
, where 'field-name' should be replaced with the name of your target query argument. In this way, the plugin will automatically get and use a value of the query (url) from the current page in the posts query.
You can also insert a into the query, making the Card context-dependent. Use $custom-arguments$.field-name
to dynamically get the shortcode argument. This allows you to copy the Card shortcode to different places and use different values, like so:
To compare the value in an ACF Date or an ACF Date/Time field to the current date and time.
Advanced Views Pro supports Post_object and Relationship field types in the Meta filters.
See the on how to display Employee CPT items on a Company CPT post.