WordPress
December 3, 2020

How To Create Meta Boxes in WordPress

A meta box is a draggable box displayed in the post editing screen in the backend of WordPress. Users can select or enter extra information in meta boxes addition to the content in the main post editing area.

There are two types of data you can enter in meta boxes: metadata (i.e. custom fields), and taxonomy terms.

1. Adding a Meta Box

WordPress provides a add_meta_box function with the specific purpose to add a new Custom Meta Box. add_meta_box has to be called from inside a callback function that should be executed when the current page’s meta boxes are loaded. This task can be performed hooking the callback to the add_meta_box_{custom-post-type} action hook, as suggested in the Codex.

That being said, let’s add the following code to the main file of a plugin or a theme’s function.php file (keeping in mind that it’s always best to create a child theme instead of altering a functions.php file):

Related Post


WordPress htaccess

The .htaccess is a distributed configuration file, and is how Apache handles configuration changes on a per-directory basis. Basic WP Multisite Subfolder Example SubDomain Example

Enable SVG Support in WordPress

For Enable svg support you’ll need to add the following code to your current themes functions.php file.

WordPress Change Password Form Without Plugin

Are you need simple Change Password form without plugin for your WordPress website? Yes, Then i have created [wc_change_pwd_form] shortcode with quick simple code. So you can put Change Password form anywhere like in Pages, Posts and Widget etc… Therefore you just need to put [wc_change_pwd_form] shortcode where you need Change Password form. So you […]

Upload Video or Image in WordPress Media Library

When we use custom form with file upload and we want to upload Video or Image in wordpress media library use following code.

How to Create Repeater Elements Using Visual Composer API

Learn how to create repeater fields for custom element of Visual Composer & WP Bakery. To achieve this, we need to write 2 functions. First one for create new element, Second one for add shortcode. function will be hooked to these specific action: vc_before_init The code Displaying Fields Values on the Frontend with shortcode. Visual […]

How to Add Excerpts to Your Pages in WordPress

you will need to add the following code to your current themes functions.php file


NEXT PAGE

Leave a Reply

Your email address will not be published. Required fields are marked *