Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Forum: Plugins
    In reply to: [A-Z Listing] Debug error

    Also interested in seeing this cleaned out from my debug logs.

    Thread Starter khalkjaer

    (@khalkjaer)

    I didn’t figure out the problem with CPT UI, as I just figured out a different solution and went with that (As I mentioned previously). If it helps you out I can mark this as resolved anyways.

    Thread Starter khalkjaer

    (@khalkjaer)

    For what it’s worth, I solved this issue on my website by adding the custom post types manually, forgoing the use of the CPT UI plugin. To do this I added the following code to my functions.php.

    
    // Hooking up our function to theme setup
    add_action( 'init', 'create_posttype' );
    
    /*
    * Creating a function to create our CPT
    */
     
    function custom_post_type() {
     
    // Set UI labels for Custom Post Type
        $labels = array(
            'name'                => _x( 'Companies', 'Post Type General Name', 'HelloChild' ),
            'singular_name'       => _x( 'Company', 'Post Type Singular Name', 'HelloChild' ),
            'menu_name'           => __( 'Companies', 'HelloChild' ),
            'parent_item_colon'   => __( 'Parent Company', 'HelloChild' ),
            'all_items'           => __( 'All Companies', 'HelloChild' ),
            'view_item'           => __( 'View Company', 'HelloChild' ),
            'add_new_item'        => __( 'Add New Company', 'HelloChild' ),
            'add_new'             => __( 'Add New', 'HelloChild' ),
            'edit_item'           => __( 'Edit Company', 'HelloChild' ),
            'update_item'         => __( 'Update Company', 'HelloChild' ),
            'search_items'        => __( 'Search Company', 'HelloChild' ),
            'not_found'           => __( 'Not Found', 'HelloChild' ),
            'not_found_in_trash'  => __( 'Not found in Trash', 'HelloChild' ),
        );
         
    // Set other options for Custom Post Type
         
        $args = array(
            'label'               => __( 'Companies', 'HelloChild' ),
            'description'         => __( 'Company news and reviews', 'HelloChild' ),
            'labels'              => $labels,
            // Features this CPT supports in Post Editor
            'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),
            // You can associate this CPT with a taxonomy or custom taxonomy. 
            'taxonomies'          => array( 'genres' ),
            /* A hierarchical CPT is like Pages and can have
            * Parent and child items. A non-hierarchical CPT
            * is like Posts.
            */ 
            'hierarchical'        => false,
            'public'              => true,
            'show_ui'             => true,
            'show_in_menu'        => true,
            'show_in_nav_menus'   => true,
            'show_in_admin_bar'   => true,
            'menu_position'       => 5,
            'can_export'          => true,
            'has_archive'         => true,
            'exclude_from_search' => false,
            'publicly_queryable'  => true,
            'capability_type'     => 'post',
            'show_in_rest' => true,
     
        );
         
        // Registering your Custom Post Type
        register_post_type( 'company', $args );
     
    }
     
    /* Hook into the 'init' action so that the function
    * Containing our post type registration is not 
    * unnecessarily executed. 
    */
     
    add_action( 'init', 'custom_post_type', 0 );
    

    Found here

    This made my original company pages show up again, and I’m pretty hesitant to tinker with turning various plugins off and on again to test things out, now that things are working as intended.

    Thread Starter khalkjaer

    (@khalkjaer)

    I’m not sure when the problem occurred during my setup, but I also installed several other wpml-related plugins for Woocommerce, Yoast and ACF support.

Viewing 4 replies - 1 through 4 (of 4 total)