In the next WordPress Wednesday, we're going to cover what I think is the final reason that makes this plugin (and the WordPress custom field functionality on the whole) so useful: querying by
custom field value.
You can also query by
custom field values, regardless what field they've been added to — this returns any post with a custom field value of «sandwich», regardless what field it appears in:
Not exact matches
However, if you want to define a
custom intensity level, also as a percentage of your MHR, for which you would like to know your target heart rate training zone, you can enter your own percentage values into the «Custom Exercise Intensity Level» f
custom intensity level, also as a percentage of your MHR, for which you would like to know your target heart rate training zone, you can enter your own percentage
values into the «
Custom Exercise Intensity Level» f
Custom Exercise Intensity Level»
fields.
Using the first snippet of code, you can order by any user meta
value, including
custom fields you have added yourself.
-LSB-...] the first snippet of code, you can order by any user meta
value, including
custom fields you have added -LSB-...]
The
custom field information is stored in key /
value pairs; the «key» is basically the name of the
custom field.
Below we're querying for posts with the
custom field «lunch» and the
value «sandwich», and posts with the
custom field «total» with a
value from 1 to 10:
Then you can output the contents of each of the
custom fields by echoing the variables you stored them in; this is especially helpful for
fields like «mobile», which may not have a
value for every profile; in those cases, you can first check if the variable is populated before outputting anything:
When outputting the
values of the «Phone»
custom field, we would now use code like a foreach -LRB--RRB- loop to output each phone number:
Out of the box, the WordPress
custom fields are a bit awkward; users have to manually add them to each post, and the
values are only tracked in text
fields.
So if you'd like, enter
custom values into the «Hotspot dimensions»
fields — the first is width, the second is height, and both
values represent the number of pixels the trigger area will occupy.