Closed rafaelcmgt closed 6 years ago
Hi @rafaelcmgt ,
is this issue related to TinyMCE or Gutenberg editor ?
could you please post a minimal example code snippet how you've created the post types ?
best regards, Andi
Hi, Thank you for the quick response.
I am not using Gutenberg. Only TinyMCE.
I created my custom post type with toolset, a suite of plugins. I used Types plugin to create de custom post type and Views plugin to show it in the front-end. Both are part of Toolset, as I said before.
i've created a minimal example code to add a custom post-type and everything works as expected: Enlighter Toolbar buttons are available and the EnlighterJS/Plugin.TinyMCE has been successful initialized.
currently i believe it is an issue with your toolset plugin - maybe they override the editor plugins/buttons. you should contact their support for further further assistance.... because it is a payed plugin and i have no possibility to test/debug it. sorry!
you should also send them a link to this issue.
in the past there were a lot of issues related to 3rd party plugin - most of the commercial providers/vendors fixed the issues related to the editor
Code
<?php
add_action('init', function(){
register_post_type(
'courses',
array(
'label' => __('Courses'),
'public' => true,
'show_ui' => true,
'supports' => array(
'title',
'editor',
'post-thumbnails',
'thumbnail',
'revisions')
)
);
register_taxonomy('coursetype', 'courses',
array(
'hierarchical' => true,
'label' => __('Course Types'),
'query_var' => 'coursetype',
'rewrite' => array('slug' => 'coursetype' )
)
);
});
Result
Sorry, I forgot to mention that the plugin works ok in the back-end. The problem is that it doesn't work in the front-end. Here is an example:
The back-end:
The front-end
I think that it might be this plugin. Other syntax hightlighter plugin works properly in my custom post type.
oh ok...it is not related to the editor...
and it works on standard posts/pages ?
edit: i've tested it with the custom post type above and everything works as expected.
do you use any kind of optimization/minification plugins ? try to disable them
btw. can you post a link to the frontend ? i will take a look on it - maybe some resources are missing
It works perfect on standard post. This web is not on production yet. This is why i am not using any optimization/minification plugins. I was using a different syntax highlighting plugin. I have deactivated it, I have activated enlighter plugin and I have just created a post in my custom post type for you to see it. This is the link:
https://www.rafaelmartinweb.com/snippet/enlighter-plugin-test/
Just in case, here you have all my activated plugins:
"Funciones" plugin is my own function plugin.
i've identified the issue: your frontend-builder
css is overriding the EnlighterJS styles - therefore you didn't see any highlighted code (the engine itself and the plugin is working fine...)
by disabling the weak css rules everything works as expected..
Hi,
You are right. In the custom post type I am using a frontend builder.
To solve my problem, I am thinking in queueing the EnlighterJS.min.css with higher priority. I don't know if this are going to work, but I will try. However, I am unable to find the part of the code where this plugin queue EnlighterJS.min.css (I need to know it in order to unqueue it). Where is it?
Thank you.
Unfortunately, it didn't work. I have decided to stop using the frontend builder for this custom post type. Now the Enlighter plugin is working properly.
Nice plugin and good support. I am going to post a good review in the wordpress repository.
Hi,
I am trying to use this plugin in my custom post types, but it doesn't work whatsoever. Is there a way to do it?