UBC Custom Field Block
Metadata in WordPress provides context, details, and attributes that help organize, categorize, and display posts effectively.
At CTLT (Centre for Teaching, Learning, and Technology), we’ve introduced a custom field block that gives you the ability to retrieve metadata from the current post or any post included within a Query Loop block.
If the Custom Field block is placed within the Post Template block that is part of a Query Loop block, you should anticipate receiving metadata that is associated with the posts generated by the Query Loop block. Conversely, if the Custom Field block is not within a Post Template block, it will retrieve metadata linked to the current post.
Table of Contents
Example – User Profiles
Data in the examples are generated by Chat-GPT. Job Title and City are saved as custom fields in the backend.
-
Emily Rodriguez
Graphic DesignerLos Angeles, CAEmily is a skilled graphic designer known for her ability to transform ideas into visually stunning creations. Her attention to detail and artistic flair make her a sought-after talent in the world of design.
-
James Smith
Software EngineerSan Francisco, CAJames is a talented software engineer who thrives on solving complex coding challenges. His dedication to writing clean and efficient code has contributed to the success of numerous software projects.
-
Sarah Johnson
Marketing ManagerNew York City, NYSarah is a seasoned marketing professional with a passion for developing innovative campaigns that drive brand awareness and customer engagement. Her strategic mindset and creativity make her a valuable asset to any marketing team.
Settings
Custom Field Name
The dropdown is going to populate all the meta keys from the database. Please choose the custom field name you wish to display on the frontend.
Code
The UBC Custom Field Block plugin is Open Source.
How to use the block on UBC CMS?
Navigate to your site’s Dashboard on UBC CMS and go to Plugins. Search for UBC Custom Field Block and activate the plugin. proceed to the specific post or page you wish to edit. Click the + button located in the top-left corner or in the desired location on the page to add a block. Finally, search for Custom Field to insert it into your content. If you intend to use it within a Query Loop block, please place the Custom Field block within the Post Template block.