Add Meta Box To Custom Post Type Archive

This file, enables you to add any type of meta box to any custom post type edit screen. In this case, we’ve added a text box which enables you to add a URL for a image which can then be printed on the front end of the CPT archive.

Simple 2 Step Installation

After downloading the zip folder for logged in members below :

Step 1 : Upload the cpt-box.php file to your child themes root directory.

Step 2 : Add the following line of PHP code to the end of your child themes functions.php file:

include_once( get_theme_file_path( '/cpt-box.php' ) );

And here’s what the code generates on CPT archive edit screens :

Demo Video

The video shows how you the code has added a new meta box and menu item to the screen options drop down menu. You can add a link to the text field in the meta box and the image displays on the frontend of the CPT archive page below the header. If no image is added, you can add a fallback.png image to your child themes images folder which will be show by default.

The meta box can be displayed on all or any CPT edit screen.

Here’s the zip file for logged in members:

Join 5000+ Followers

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