Problem: I would like to display the title of the post selected in a post reference field using PHP, but when I output the value of types_render_field I get a number.
Solution: This number is the referenced post ID. You can use it to get the post title with the WordPress function get_the_title:
Problem: Some of my conditionals that previously worked to test Product Category assignment no longer work as expected.
Solution: Use the following syntax with the WordPress function has_term to test whether or not the current post has one or more of the desired terms assigned.
[wpv-conditional if="( has_term( 'Discogs', 'product_cat', null ) eq '1' ) AND ( has_term( 'Vinyl', 'product_cat', null ) eq '1' )"]
...this post has the terms 'Discogs' and 'Vinyl' in the Product Category taxonomy.
[/wpv-conditional]
[wpv-conditional if="( has_term( 'Discogs', 'product_cat', null ) ne '1' ) AND ( has_term( 'Vinyl', 'product_cat', null ) ne '1' )"]
...this post has neither the term 'Discogs' nor the term 'Vinyl' in the Product Category taxonomy.
[/wpv-conditional]
[wpv-conditional if="( has_term( 'Discogs', 'product_cat', null ) ne '1' ) AND ( has_term( 'Vinyl', 'product_cat', null ) eq '1' )"]
...this post has the term 'Vinyl' but not the term 'Discogs' in the Product Category taxonomy.
[/wpv-conditional]
[wpv-conditional if="( has_term( 'Discogs', 'product_cat', null ) eq '1' ) AND ( has_term( 'Vinyl', 'product_cat', null ) ne '1' )"]
...this post has the term 'Discogs' but not the term 'Vinyl' in the Product Category taxonomy.
[/wpv-conditional]