Forum Replies Created
-
AuthorPosts
-
[email protected]
ParticipantThank you, I missed that one.
[email protected]
ParticipantThis was too easy and I should have found this in the forum.
It works and thank you for your help!
Kind regards,
Ivan.
[email protected]
ParticipantSorry change it to: Leeftijdscategori & e u m l ; n (otherwise you don't see the difference, remove the spaces).
[email protected]
ParticipantI found the problem the name leeftijdscategoriën the ë is the problem, change this to leeftijdscategoriën and it is fixed.
Thank you for your help.
May 13, 2021 at 4:12 PM in reply to: ✅Post type and taxonomy not connected when copying php code #28152[email protected]
ParticipantThat was exactly the problem and solution I was looking for.
Thank you!
May 13, 2021 at 2:04 PM in reply to: ✅Post type and taxonomy not connected when copying php code #28148[email protected]
ParticipantI de-activated the Metabox Custom Post type plug-in.
The code I generated for the post type and taxanomy is this:
<?php
add_action( 'init', 'ivanit_messages' );
function ivanit_messages() {
$labels = [
'name' => esc_html__( 'Messages', 'ivanit-messages' ),
'singular_name' => esc_html__( 'Message', 'ivanit-messages' ),
'add_new' => esc_html__( 'Add New', 'ivanit-messages' ),
'add_new_item' => esc_html__( 'Add new message', 'ivanit-messages' ),
'edit_item' => esc_html__( 'Edit Message', 'ivanit-messages' ),
'new_item' => esc_html__( 'New Message', 'ivanit-messages' ),
'view_item' => esc_html__( 'View Message', 'ivanit-messages' ),
'view_items' => esc_html__( 'View Messages', 'ivanit-messages' ),
'search_items' => esc_html__( 'Search Messages', 'ivanit-messages' ),
'not_found' => esc_html__( 'No messages found', 'ivanit-messages' ),
'not_found_in_trash' => esc_html__( 'No messages found in Trash', 'ivanit-messages' ),
'parent_item_colon' => esc_html__( 'Parent Message:', 'ivanit-messages' ),
'all_items' => esc_html__( 'All Messages', 'ivanit-messages' ),
'archives' => esc_html__( 'Message Archives', 'ivanit-messages' ),
'attributes' => esc_html__( 'Message Attributes', 'ivanit-messages' ),
'insert_into_item' => esc_html__( 'Insert into message', 'ivanit-messages' ),
'uploaded_to_this_item' => esc_html__( 'Uploaded to this message', 'ivanit-messages' ),
'featured_image' => esc_html__( 'Featured image', 'ivanit-messages' ),
'set_featured_image' => esc_html__( 'Set featured image', 'ivanit-messages' ),
'remove_featured_image' => esc_html__( 'Remove featured image', 'ivanit-messages' ),
'use_featured_image' => esc_html__( 'Use as featured image', 'ivanit-messages' ),
'menu_name' => esc_html__( 'Messages', 'ivanit-messages' ),
'filter_items_list' => esc_html__( 'Filter messages list', 'ivanit-messages' ),
'filter_by_date' => esc_html__( '', 'ivanit-messages' ),
'items_list_navigation' => esc_html__( 'Messages list navigation', 'ivanit-messages' ),
'items_list' => esc_html__( 'Messages list', 'ivanit-messages' ),
'item_published' => esc_html__( 'Message published', 'ivanit-messages' ),
'item_published_privately' => esc_html__( 'Message published privately', 'ivanit-messages' ),
'item_reverted_to_draft' => esc_html__( 'Message reverted to draft', 'ivanit-messages' ),
'item_scheduled' => esc_html__( 'Message scheduled', 'ivanit-messages' ),
'item_updated' => esc_html__( 'Message updated', 'ivanit-messages' ),
'text_domain' => esc_html__( 'ivanit-messages', 'ivanit-messages' ),
];
$args = [
'label' => esc_html__( 'Messages', 'ivanit-messages' ),
'labels' => $labels,
'description' => '',
'public' => true,
'hierarchical' => false,
'exclude_from_search' => false,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'show_in_rest' => true,
'query_var' => true,
'can_export' => true,
'delete_with_user' => true,
'has_archive' => true,
'rest_base' => '',
'show_in_menu' => true,
'menu_icon' => 'dashicons-admin-home',
'menu_position' => '',
'capability_type' => 'post',
'supports' => ['title', 'editor', 'thumbnail'],
'taxonomies' => ['topic'],
'rewrite' => [
'with_front' => false,
],
];register_post_type( 'message', $args );}
add_action( 'init', 'ivanit_topics' );
function ivanit_topics() {
$labels = [
'name' => esc_html__( 'Topics', 'ivanit-topics' ),
'singular_name' => esc_html__( 'Topic', 'ivanit-topics' ),
'menu_name' => esc_html__( 'Topics', 'ivanit-topics' ),
'search_items' => esc_html__( 'Search Topics', 'ivanit-topics' ),
'popular_items' => esc_html__( 'Popular Topics', 'ivanit-topics' ),
'all_items' => esc_html__( 'All Topics', 'ivanit-topics' ),
'parent_item' => esc_html__( 'Parent Topic', 'ivanit-topics' ),
'parent_item_colon' => esc_html__( 'Parent Topic', 'ivanit-topics' ),
'edit_item' => esc_html__( 'Edit Topic', 'ivanit-topics' ),
'view_item' => esc_html__( 'View Topic', 'ivanit-topics' ),
'update_item' => esc_html__( 'Update Topic', 'ivanit-topics' ),
'add_new_item' => esc_html__( 'Add new topic', 'ivanit-topics' ),
'new_item_name' => esc_html__( 'New topic name', 'ivanit-topics' ),
'separate_items_with_commas' => esc_html__( 'Separate topics with commas', 'ivanit-topics' ),
'add_or_remove_items' => esc_html__( 'Add or remove topics', 'ivanit-topics' ),
'choose_from_most_used' => esc_html__( 'Choose most used topics', 'ivanit-topics' ),
'not_found' => esc_html__( 'No topics found', 'ivanit-topics' ),
'no_terms' => esc_html__( 'No Topics', 'ivanit-topics' ),
'filter_by_item' => esc_html__( 'Filter by topic', 'ivanit-topics' ),
'items_list_navigation' => esc_html__( 'Topics list pagination', 'ivanit-topics' ),
'items_list' => esc_html__( 'Topics list', 'ivanit-topics' ),
'most_used' => esc_html__( 'Most Used', 'ivanit-topics' ),
'back_to_items' => esc_html__( 'Back to topics', 'ivanit-topics' ),
'text_domain' => esc_html__( 'ivanit-topics', 'ivanit-topics' ),
];
$args = [
'label' => esc_html__( 'Topics', 'ivanit-topics' ),
'labels' => $labels,
'description' => '',
'public' => true,
'publicly_queryable' => true,
'hierarchical' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'meta_box_cb' => true,
'show_in_rest' => true,
'show_tagcloud' => true,
'show_in_quick_edit' => true,
'show_admin_column' => false,
'query_var' => true,
'sort' => false,
'rest_base' => '',
'rewrite' => [
'with_front' => false,
'hierarchical' => false,
],
];
register_taxonomy( 'topic', ['message'], $args );
}?>
Thank you for your help.
-
AuthorPosts