Archived topic
How To Use Two Custom Fields In 1 Line of Text In Template Element
7 replies · Started by Brent Wilson on February 15, 2022
How can I pull content from two different custom fields and combine it into one line of text (this is for a content template element)? For example, if I have a custom field for First_Name and a custom field for Last_Name, how can I display those as First_Name Last_Name centered in the template?
Hi Brent,
If you can display the custom fields values from a shortcode(if you're using ACF, it has one), you can place 2 shortcodes for each of the field inside 1 GB Headline block. Like this - https://share.getcloudapp.com/wbuYgB8y
Alternatively, you can have them on their own GB headline block and have both these block display in an inline manner.
You can set them to "inline width" by toggling it on their Spacing setting as shown here - https://share.getcloudapp.com/jkumk8m4
Great. Thank you! I am using Metabox and was able to get a couple of shortcodes to work to allow me to combine first and last name custom fields.
Thanks for letting us know. glad you got it sorted. :D
Let us know if you need further help .:D
Hi Elvin,
Unfortunately, your getcloudapp.com link is not valid any longer. Can you post the solution again here?
Thanks!
Hi Alexander,
If you are trying to use the GB headline block to pull the dynamic data, you can set the headline block to inline width:
https://docs.generateblocks.com/article/headline-overview/#inline-width
If if doesn't work, can you open a new topic? Thanks!
That worked perfectly, thanks!
No Problem, glad to help :)