最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

theme development - See double taxonomy inputs in WP editor

matteradmin9PV0评论

I registered 3 taxonomies for a custom post type, but they show up in 2 places when editing a custom post type.

I would like to only display the input boxes on the right of the editor. How to remove the drop down input under my custom fields?

3x input under the custom field AND on the right:

When I remove my registration code from functions.php, and refresh this is the result:

My registration code from functions.php:

function ledensubsector_init() {
    register_taxonomy(
        'subsector',
        'leden',
        array(
            'label' => __( 'Sub-sector' )
        )
    );
}
add_action( 'init', 'ledensubsector_init' );

function ledensupplychain_init() {
    register_taxonomy(
        'supplychain',
        'leden',
        array(
            'label' => __( 'Supply chain' )
        )
    );
}
add_action( 'init', 'ledensupplychain_init' );

function ledentechnology_init() {
    register_taxonomy(
        'technology',
        'leden',
        array(
            'label' => __( 'Technology' )
        )
    );
}
add_action( 'init', 'ledentechnology_init' );

I registered 3 taxonomies for a custom post type, but they show up in 2 places when editing a custom post type.

I would like to only display the input boxes on the right of the editor. How to remove the drop down input under my custom fields?

3x input under the custom field AND on the right:

When I remove my registration code from functions.php, and refresh this is the result:

My registration code from functions.php:

function ledensubsector_init() {
    register_taxonomy(
        'subsector',
        'leden',
        array(
            'label' => __( 'Sub-sector' )
        )
    );
}
add_action( 'init', 'ledensubsector_init' );

function ledensupplychain_init() {
    register_taxonomy(
        'supplychain',
        'leden',
        array(
            'label' => __( 'Supply chain' )
        )
    );
}
add_action( 'init', 'ledensupplychain_init' );

function ledentechnology_init() {
    register_taxonomy(
        'technology',
        'leden',
        array(
            'label' => __( 'Technology' )
        )
    );
}
add_action( 'init', 'ledentechnology_init' );
Share Improve this question asked Dec 18, 2018 at 11:08 LudoLudo 612 silver badges11 bronze badges 2
  • Have you added custom fields for them with ACF? Looks like you have. You won’t need those. WordPress adds them for you. – Jacob Peattie Commented Dec 18, 2018 at 11:16
  • Indeed, I did that with ACF- totally forgot it. I'll just have to remove it. Thanks! – Ludo Commented Dec 18, 2018 at 11:19
Add a comment  | 

1 Answer 1

Reset to default 0

WP adds the inputs automatically. I forgot that I added the inputs for the taxonomies also with AFC. So I just had to remove them from my custom fields.

Post a comment

comment list (0)

  1. No comments so far