Problem with custom post type
-
I added custom post type for template. Into functions.php
add_action( 'init', 'true_register_post_type_init' ); function true_register_post_type_init() { $labels = array( 'name' => 'Публікації', 'singular_name' => 'Публікація', 'add_new' => 'Додати публікацію', 'add_new_item' => 'Додати публікацію', 'edit_item' => 'Редагувати публікацію', 'new_item' => 'Нова публікація', 'all_items' => 'Всі публікації', 'search_items' => 'Шукати публікації', 'not_found' => 'Публікації в таких видах не знайдено', 'not_found_in_trash' => 'В корзині таких публікацій не знайдено', 'menu_name' => 'Публікації' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => false, 'has_archive' => false, 'menu_icon' => 'dashicons-email-alt2', 'menu_position' => 5, 'supports' => array( 'title', 'editor', 'custom-fields' ), 'taxonomies' => 'category', ); register_post_type( 'publications', $args ); }Now I’m getting a warning in the template
Warning: foreach() argument must be of type array|object, string given in D:\OSPanel\domains\redwerk-test.loc\wp-includes\class-wp-post-type.php on line 699I find the same problem in this topic but don’t undestand how to fix it. Can you help me please?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Problem with custom post type’ is closed to new replies.
