This tutorial will guide you through the process of adding a custom meta field to the Project Details meta box and display the content of it on the frontend via the filters within Projects. As an example we’ll be adding a ‘location’ field.
All the snippets in this tutorial should be added to the
functions.php file of your child theme. Alternatively you could create a custom plugin and add the code there so that the customization is portable between themes.
Adding the field to the meta box ↑ Back to top
This adds the location field:
All data saving is handled by the plugin. That’s it! You added a new meta field.
Displaying the custom field data on the frontend ↑ Back to top
Now let’s display the contents of that new meta field in the projects archive.
This snippet displays the location after the short description on project archives.
The important part of this snippet is the code inside the function. You can use this to output the custom field data in any template file. For example you could add this to single-project/meta.php to display the data on the single page. You can read about safely editing Projects templates here.
Supported input types ↑ Back to top
As of Projects 1.2.0 you can add a variety of input boxes making the possibilities for output on the frontend endless!
- Custom (use the
You can use the following snippet to add these input types: