Tagged: Custom Post Type
-
AuthorPosts
-
March 31, 2016 at 8:13 pm #606182
HI, strange thing happening. I have created a Custom Post Type in Enfold. When I add the line that supports excerpts and thumbnails (http://screencast.com/t/lEZLI3lNdc), suddenly any pop-up text block editors appear white. My console shows this error: ‘quicktags is not defined’ http://screencast.com/t/7Jpmcr41hE. When I comment out that line in my CPT definition, everything is fine, but I also notice that Firebugging the editor shows a completely different set of classes and wrappers on that same text block editor, simply when I have that line in or out of the CPT definition. I don’t think it’s a plugin since this is what triggers the problem on/off. Everything is up to date, the WP core is 4.4.2 and Enfold is 3.5.
March 31, 2016 at 8:49 pm #606223Hi!
Try using this code to enable ALB on your CPT instead;
add_filter('avf_builder_boxes','enable_boxes_on_posts'); function enable_boxes_on_posts($boxes) { $boxes[] = array( 'title' =>__('Avia Layout Builder','avia_framework' ), 'id'=>'avia_builder', 'page'=>array('portfolio', 'page', 'post', 'CTP SLUG'), 'context'=>'normal', 'expandable'=>true ); $boxes[] = array( 'title' =>__('Layout','avia_framework' ), 'id'=>'layout', 'page'=>array('portfolio', 'page', 'post', 'CTP SLUG'), 'context'=>'side', 'priority'=>'low'); $boxes[] = array( 'title' =>__('Additional Portfolio Settings','avia_framework' ), 'id'=>'preview', 'page'=>array('portfolio', 'page', 'post', 'CTP SLUG'), 'context'=>'normal', 'priority'=>'high' ); return $boxes; }
Cheers!
JosueMarch 31, 2016 at 11:03 pm #606317Josue- thanks for the quick reply. But that seemed to render almost everything gone. It left me only the excerpt. http://screencast.com/t/PzTHu1Jm. No JS errors, just missing the main parts of the editor now. This is how I changed my functions: http://screencast.com/t/UJUH99ca5Hl.
March 31, 2016 at 11:15 pm #606324Ok revert back to the old code you were using. Can you please create me a WordPress administrator account? post it here as a private reply.
March 31, 2016 at 11:21 pm #606332Attaching in private…
March 31, 2016 at 11:28 pm #606335When registering the Members CPT you missed
editor
from thesupports
parameter so TinyMCE wasn’t being included there, i’ve changed it to:// CPT for Team Members function create_posttype() { register_post_type( 'team_members', // CPT Options array( 'labels' => array( 'name' => __( 'Team Members' ), 'singular_name' => __( 'Team Member' ) ), 'public' => true, 'supports' => array( 'excerpt', 'thumbnail', 'editor' ), 'has_archive' => true, 'rewrite' => array('slug' => 'team-members'), ) ); }
March 31, 2016 at 11:32 pm #606340Awesome. You learn something every day (10 minutes:) I don’t think I’ve ever included it before and maybe was just lucky it didn’t cause a problem! Or maybe I did and didn’t realize.
Thanks!
March 31, 2016 at 11:34 pm #606341You are welcome, glad to help :)
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.