I have created some user custom fields :
- annee => numerical custom field
- type-membre => radio field
Now, I would like to place a condition that follows the 3 rules (AND) :
- user has author role
- annee is equal to current year
- type-membre is equal to a specific value (let say "eleveur" here)
I have a first condition for the author role :
[wpv-conditional if="( '[wpv-post-author format="meta" meta="user_level"]' eq '2' )"]
Could you help to add the other conditions?
Thanks
Pat
Concerning the year, I need to compare with the current year (ie : 2019 currently but for next year, it should be 2020 without having to change the code). If I'm right, there is a kind of parameter in Views for that ?
Sorry for coming back again on this topic, but something is going wrong.
I started first with the [wpv-conditional if="( '[wpv-post-author format="meta" meta="user_level"]' eq '2' )"] and it's working fine.
Then I tried to add a second condition :
[wpv-conditional if="( '[wpv-post-author format="meta" meta="user_level"]' eq '2' ) AND ( '[types usermeta="type-de-membre" id="[wpv-post-author format='meta' meta='ID']"' eq 'ELEVEUR' )"] and nothing was displayed.
If I put the shortcodes [wpv-post-author format='meta' meta='ID'] in the loop, I'm getting the post author ID and if I place [types usermeta="type-de-membre" id="[wpv-post-author format='meta' meta='ID'] also in the loop, then I'm getting the 'ELEVEUR' result
So it seems all shortcodes are working fine separately but are not working if I place them in the condition.
Another point is that I tried with this condition :[wpv-conditional if="( '[wpv-post-author format="meta" meta="user_level"]' eq '2' ) AND ( '[types usermeta="type-de-membre" id="[wpv-post-author format='meta' meta='ID']"' eq 'ELEVEUR' )"] (OR instead of AND) and nothing was displayed which is strange as the first condition should always be taken into consideration !!!
Can you find any idea on why the condition is not running well?