Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #914091

    This topic was closed but was not resolved so I am reposting.

    I have multiple post types, but the example is not clear as to how to add more than one. I am getting an error when trying to update it. I think the issue is with the comma separator.
    What is the correct code to add multiple custom post types to the example as outlined in

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

    When I try that code I get an error from wordpress when updating the functions file.

    #914297

    Hey roamingk,

    What is the error that you’re getting?

    Best regards,
    Victoria

    #914318

    Hi Victoria,

    Wordpress yields the following result when saving.

    Your PHP code changes were rolled back due to an error on line 656 of file wp-content/themes/enfold/functions.php. Please fix and try saving again.

    syntax error, unexpected ‘,’

    #914526

    Hi,

    I do not see any error from the code that she has provided.
    Can you provide us with backend details?

    Best regards,
    Basilis

    #915629
    This reply has been marked as private.
    #916232

    Hi,

    I tried to login with Enfold users and it failed.

    Best regards,
    Basilis

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.