Hi
Is there a way to whatever is in X field add 1 on to this value. So if the value is 3 we can output on the page 4?
Thanks.
Hello,
Please elaborate the question with more details:
So if the value is 3 we can output on the page 4?
How do you setup the custom field and field value? What and where do you want to output?
If you want to check the custom field value, and display something, please try the shortcode [wpv-conditional]:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
Sorry I will try to explain with more detail.
Say we have a field called wpcf-amount
This field on a post has a value thats been set of "4" in the field.
What I want do on a view is print on the page this value but +1. So instead of showing 4 on the page it shows the number 5. It always wants to just add 1 to the value of whatever the field is.
Thanks
There isn't such a built-in feature within Views plugin, but you can try to create some custom codes to do the calculation, for example, this thread:
https://toolset.com/forums/topic/calculator/
The only issue with this solution is needing to edit functions.php which we can’t do as when the theme updates it’ll wipe out our changes.
Is there any way to avoid this?
Yes, you can setup the PHP codes with some plugin, for example:
https://wordpress.org/plugins/code-snippets/
Then you will be able to add PHP codes in wordpress admin side without touching your theme files.