• Resolved rwebn

    (@rwebn)


    Hi

    With Gutenberg, when I add a new article, I miss a lot of option in the right pannel. So I went to preferences -> pannel and… I can on/off thoses : (in French)

    wp-Typography
    Yoast SEO
    Image mise en avant
    Extrait
    Commentaires

    I can’t chose templates/tag/category… Do you know why?

    thanks

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi @rwebn!

    Sounds like a pretty weird problem, not showing category or tag options. Could you share more about the situation of your site, like, what WordPress version it is using? What are you currently viewing in the right panel? The related link is broken so it’s hard to tell without more details.

    Moderator bcworkz

    (@bcworkz)

    Are your articles a custom or added post type? i.e. not one of the default post or page types. Only post types that have category or post-tag taxonomies associated with them will display the related meta boxes in the editor.

    If your article post type doesn’t have associated taxonomies, they can be associated with some custom code.

    The template meta box is only for the page post type. AFAIK it cannot be applied to other post types. However, any template can be applied to any front end request through the “template_include” filter.

    Thread Starter rwebn

    (@rwebn)

    Hi, they’re created with ACF but I tried without any plugin. And with a default theme… but I still not see the categories and tags.

    And I use 6.2.2 version.

    Moderator bcworkz

    (@bcworkz)

    ACF adds post types? TIL! There may be a way to associate taxonomies with ACF created post types within the plugin. I recommend asking for guidance through their dedicated support forum.

    In any case, any taxonomy can be associated with any added post type with register_taxonomy_for_object_type(). There are some basic examples at the bottom of the linked doc page.

    Thread Starter rwebn

    (@rwebn)

    hum… I reinstall the site with no plug ins and with default theme… And I have still nothing (“extrait” et “commentaire”, in French). :/ I assume it’s in the database but for technical reasons I have a limited access… and I need to keep all other things so…

    Do you know if a request in the database can help?

    Moderator bcworkz

    (@bcworkz)

    No plugins? If post types are created with ACF, you likely need at least ACF active for them to work right. While some related data is in the DB, what gets the respective taxonomy meta boxes to appear in the editor happens dynamically with a combination of core code and the post type registration code that’s presumably part of ACF.

    What I think is happening is the post type is registered without an appropriate argument relating taxonomies to the post type. This can be done after the post type is registered with custom code that calls register_taxonomy_for_object_type(), which I linked to in my last reply.

    I’m not 100% sure that’s the problem, but using that function would be the first thing I’d try to remedy the situation.

    Thread Starter rwebn

    (@rwebn)

    So after checking
    only the “page” and “post” types have this problem. All the fields registered in custom-post.php do not have this problem.

    I’ve tried a few codes and I saw that the old dev had also tried… but it doesn’t work. For example

    public function add_category_to_pages() {
        register_taxonomy_for_object_type('post_tag', 'page');
        // Add category metabox to page
        register_taxonomy_for_object_type('category', 'page');
    }

    function add_taxonomies_to_post_and_page() {
    global $wp_post_types
    if (post_type_exists('post')) {
        // Récupérer l'objet existant
        $post_obj = $wp_post_types['post'];
    
        if (!in_array('post_tag', $post_obj->taxonomies)) {
            $post_obj->taxonomies[] = 'post_tag';
        }
        if (!in_array('category', $post_obj->taxonomies)) {
            $post_obj->taxonomies[] = 'category';
        }
    }
    if (post_type_exists('page')) {
        $page_obj = $wp_post_types['page'];
        if (!in_array('post_tag', $page_obj->taxonomies)) {
            $page_obj->taxonomies[] = 'post_tag';
        }
        if (!in_array('category', $page_obj->taxonomies)) {
            $page_obj->taxonomies[] = 'category';
        }
    }}add_action('init', 'add_taxonomies_to_post_and_page', 20);

    function ajouter_categories_et_tags_a_tous_les_types() {
    $post_types = get_post_types(array('public' => true), 'names');
    foreach ($post_types as $post_type) {
     
        register_taxonomy_for_object_type('category', $post_type);
        register_taxonomy_for_object_type('post_tag', $post_type);
    }
    }
    add_action('init', 'ajouter_categories_et_tags_a_tous_les_types');

    Elsewhere, I saw someone talking about “wp super cache”, I’ve installed it, I’ve cleared the cache but it doesn’t work… they’re also talking about restarting the server, but I can’t get hold of that, it’ll be restarted tonight. We’ll see tomorrow if this solution is ok, but I doubt about it. ^^

    Thread Starter rwebn

    (@rwebn)

    ok… “fun”, it was other thing. the vhost was bad and when we used redirection (for api / json for example), the variable $_GET was erased. so… bugs…

    I learnt a lot with this case. thanks for reading my dispair.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘guttemberg preferences pannels missing’ is closed to new replies.