How To Add A Genesis Meta Box For Custom URLS

This download folder contains code which adds a text field on your single post/page/cpt edit screen for internal or external links.

Genesis includes several functions to make it easier to add custom meta boxes in Genesis child themes.

genesis_sanitize_html – Custom function located in genesis > lib > functions > formatting.php which uses a WordPress function to ensure the user inputed data is in proper form and remove any invalid characters.

genesis_save_custom_fields – Custom function located in genesis > lib > functions > options.php which uses WordPress functions to save the custom field key & value to the database if a value is added or changed.

Demo Video

Shows an external URL added to a custom meta box named Custom URL used to link a button on a single post.

Tested using the Genesis Sample child theme by StudioPress however will work in any Genesis child theme.

Installation Steps

There’s 2 steps :

  1. # Upload the file named url-form.php to your child theme folder like this :
  2.  

  3. # Copy & paste the code from functions.php to the end of your child themes functions file.
  4.  

Download Folder

Join 5000+ Followers

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