Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #722421

    Hi,

    I’m using the following to enable the advanced editor on “event” but I also need to have it enabled for “event-recurring” but I’m really struggling with what should be a simple bit of php code.

    / Enable Enfold Advance Layout Editor on Event pages
    add_filter('avf_builder_boxes', 'add_builder_to_posttype');
    function add_builder_to_posttype($metabox)
    {
    	foreach($metabox as &$meta)
    	{
    		if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout')
    		{
    			$meta['page'][] = 'event'; /*instead add the name of the custom post type here*/
    		}
    	}
    	return $metabox;
    }
    #723421

    Hey DigitalEssence,

    You can copy this part of the code:

    $meta['page'][] = 'event';

    paste it just the bottom of it then replace event with event-recurring, it should look like this:

    add_filter('avf_builder_boxes', 'add_builder_to_posttype');
    function add_builder_to_posttype($metabox)
    {
    	foreach($metabox as &$meta)
    	{
    		if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout')
    		{
    			$meta['page'][] = 'event'; /*instead add the name of the custom post type here*/
    			$meta['page'][] = 'event-recurring';
    		}
    	}
    	return $metabox;
    }

    Let us know if it works.

    Best regards,
    Nikko

    #723662

    Perfect,

    that’s both types of pages using the Advanced Editor.

    thank you. If I’d known it was that simple…

    #723834

    Hey!

    You’re very much welcome. Thanks for using Enfold :)

    Regards,
    Nikko

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘HOWTO: Enable advance layout editor on more than one type of page?’ is closed to new replies.