How to add new custom page or post blocks?

You’re looking for custom meta boxes. These allow you to add sections to the WordPress post and/or page screens that look like standard title, editor, category selection, etc. Generally speaking, you determine where they are rendered and what type of input elements are used.

Without knowing exactly what you’re trying to do, it’s not possible to provide a tutorial but there are a number of resources that will get you started:

  • The WordPress Codex has a decent article that explains the API function.

  • I’ve written a two-part article (Part 1, Part 2) that walks you through adding a custom meta box and referencing it in your post and/or pages.

  • Here’s another solid tutorial (Part 1, Part 2, Part 3) that does an excellent job of providing an introduction and working example of how to create your own custom meta boxes.

Reviewing this articles should provide you with a solid foundation to get started on writing your own functionality.

Leave a Comment