This tutorial provides the code for adding meta boxes in Genesis and uses 2 functions native to Genesis:
I’ve already published 2 posts containing 2 different code snippets for creating meta boxes in WordPress if you’re not using Genesis. Either way, all code works in Genesis and doesn’t make much difference which code you use.
The only difference with the code in this tutorial is you don’t need to create a custom field. You simply paste the value for the field you want to use in the custom meta box this code generates.
In this example, the code generates a box which is 3 rows high for a URL which you can grab after uploading your media file to the WordPress Media Library and output anywhere as a image, audio file or video file.
I tested this code with the Podcast child theme i created which uses the native WordPress custom fields meta box.
Here’s the box it produces:
You can modify the code to:
- Change the position the box is displayed on Edit Post screens.
- Change the height of the box by changing the amount of rows and columns
- Use any of the parameters available when using the add_meta_box function
- Control which users can use and see the box
Here’s the code you simply paste in your child themes functions file:
Was This Tutorial Helpful?