Add Meta Box in Genesis

This tutorial provides the code for adding meta boxes in Genesis and uses 2 functions native to Genesis:

Note: The code won’t work in non Genesis child themes however it provides an easier way to code meta boxes into your child theme as opposed to using all the code needed by a non Genesis child theme.

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:

meta-box

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:

Related Code Snippets


Comments

2 responses to “Add Meta Box in Genesis”

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.