The separator control is meant to define the separator between each meta, not the meta content itself. Weâre studying alternatives for what youâre trying to achieve.
Use the new dynamic data filter to set the separator: For a space use {post_terms_post_tag: } ; for a pipe use {post_terms_post_tag: | }
Hook on the new WP filter âbricks/dynamic_data/post_terms_separatorâ and set the post terms separator globally for all the dynamic data âpost_terms_â tags. As one example:
Hello I am trying with bricks v.1.5.5 the first option but it is not working, is it a bug or I am missing something?
I am trying with:
{post_terms_post_tag: } (space after the colon) or something else like the pipe as you suggested but I am always get the comma as separator.
{post_terms_post_tag: }
result:
Tag1, Tag2, Tag3
The documentation page about Filters on dynamic data says that is possible âPost term separatorâ
:text value â Depending on the context it could mean the following:
User or term custom field meta key
The URL parameter key
Post terms separator
Date format
Image size slug (e.g. thumbnail, or full)
The echo tag function name
So with the post Element I need to show meta Category field (only one the parent) and I need to make it linked.
When I try
{post_terms_category:link} Shows all Categories and correctly linked
{post_terms_category:1} | Shows 1 Category correctly but not linked
{post_terms_category:1:link} Shows 1 category but linked to the post link
How can I have it Show 1 category with a link to the category?
Aaaah multiple words
Currently, there is no filter to show only one category, but thankfully you can use your own function and call it via {echo:yourFunction}
Something like this should work:
// Filter to show the first category assigned to the post
add_filter( 'wp_get_object_terms', 'my_prefix_filter_terms', 10, 4 );
function my_prefix_filter_terms( $terms, $object_ids, $taxonomies, $args ) {
if ( ! empty( $terms ) && is_array( $taxonomies ) && in_array( 'category', $taxonomies ) ) {
return [ $terms[0] ];
}
return $terms;
}