Enfold – Enable Avia Builder on CPT

WordPress - Enfold Theme Custom Post Types Sidebar / Widget Areas Functions PHP

Snippet Overview

Enfold – Enable Avia Builder on CPT

Although the Enfold theme brings a lot to the table, sometimes you need to add additional Custom Post Type sections to accommodate unique content. The two functions below allow you to enable the Avia Builder and Layout Panel (Sidebar Options, Title Bar Options and Header Options) on your Custom Post Type’s edit screen within WordPress.

Enable Avia Builder

To enable the Avia Builder on your Custom Post Type’s edit screen paste the code below into your themes functions.php file. Edit the code below where it says “your-custom-post-type-name” to the name of your Custom Post Type.

// Enable Avia Builder on Custom Post Type

function avf_alb_supported_post_types_mod( array $supported_post_types ) {
	$supported_post_types[] = 'your-custom-post-type-name';
	return $supported_post_types;
}

add_filter('avf_alb_supported_post_types', 'avf_alb_supported_post_types_mod', 10, 1);

Enable Layout Panel

To enable the Layout Panel on your Custom Post Type’s edit screen paste the code below into your themes functions.php file. Edit the code below where it says “your-custom-post-type-name” to the name of your Custom Post Type.

// Enable Layout Panel on Custom Post Type

function avf_metabox_layout_post_types_mod( array $supported_post_types ) {
	$supported_post_types[] = 'your-custom-post-type-name';
	return $supported_post_types;
}

add_filter('avf_metabox_layout_post_types', 'avf_metabox_layout_post_types_mod', 10, 1);
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply