These 3 code snippets all produce exactly the same result on the front end:
The code enables you to display the value of all custom fields in 1 line. There’s no need to use CSS for this solution as it can all be done using PHP code. You can also use the 3rd example to style each value differently.
The 4th example creates a shortcode you can use in the WordPress editor or anywhere that shortcodes can be parsed like a text widget.
The code examples include solutions which work in any WordPress theme & solutions which only work in Genesis child themes.
Here’s the code:
Hi,
Thanks for a great resource! I am using this method to create a shortcode for a sidebar widget. It’s working perfectly except that two of my fields are arrays. How can I display these two fields with commas separating each item in each array? Here is what I have so far (energetics and actions are the two array fields).
Thanks!
Terry McDonald (kemahbreeze)
Hi Terry. I would like to help you with this question however i don ‘t fully understand what you are trying to do.
Hi Brad,
Never mind. I worked it out. I used implode() to turn the arrays into strings.
Thanks,
Terry