0

this is my link. http://redesign.conei-sa.com/apps_cat . not found .

My code in function.php.

function prefix_register_post_type()
{
    register_post_type(
        'application',
        array(
            'labels'        => array(
                'name'               => __('Application', 'text_domain'),
                'singular_name'      => __('Application', 'text_domain'),
                'menu_name'          => __('Application', 'text_domain'),
                'name_admin_bar'     => __('Application Item', 'text_domain'),
                'all_items'          => __('All Items', 'text_domain'),
                'add_new'            => _x('Add New', 'prefix_portfolio', 'text_domain'),
                'add_new_item'       => __('Add New Item', 'text_domain'),
                'edit_item'          => __('Edit Item', 'text_domain'),
                'new_item'           => __('New Item', 'text_domain'),
                'view_item'          => __('View Item', 'text_domain'),
                'search_items'       => __('Search Items', 'text_domain'),
                'not_found'          => __('No items found.', 'text_domain'),
                'not_found_in_trash' => __('No items found in Trash.', 'text_domain'),
                'parent_item_colon'  => __('Parent Items:', 'text_domain'),
            ),
            'public'        => true,
            'menu_position' => 5,
            'supports'      => array(
                'title',
                'editor',
                'thumbnail',
                'excerpt',
                'custom-fields',
            ),
            'taxonomies'    => array(
                'apps_cat',
            ),
            'has_archive'   => true,
            'rewrite'       => array(
                'slug' => 'application',
            ),
        )
    );
}

add_action('init', 'prefix_register_post_type');


    function prefix_register_taxonomy()
    {
        register_taxonomy(
            'apps_cat',
            array(
                'application',
            ),
            array(
                'labels'            => array(
                    'name'              => _x('Categories', 'prefix_portfolio', 'text_domain'),
                    'singular_name'     => _x('Category', 'prefix_portfolio', 'text_domain'),
                    'menu_name'         => __('Categories', 'text_domain'),
                    'all_items'         => __('All Categories', 'text_domain'),
                    'edit_item'         => __('Edit Category', 'text_domain'),
                    'view_item'         => __('View Category', 'text_domain'),
                    'update_item'       => __('Update Category', 'text_domain'),
                    'add_new_item'      => __('Add New Category', 'text_domain'),
                    'new_item_name'     => __('New Category Name', 'text_domain'),
                    'parent_item'       => __('Parent Category', 'text_domain'),
                    'parent_item_colon' => __('Parent Category:', 'text_domain'),
                    'search_items'      => __('Search Categories', 'text_domain'),
                ),
          'public' => true,
                'show_admin_column' => true,
                'hierarchical'      => true,
          'query_var' => true,
          "rewrite" => true,


                'rewrite'           => array(
                    'slug' => 'apps_cat',
                ),
            )
        );
    }

    add_action('init', 'prefix_register_taxonomy', 0);

The link is found redesign.conei-sa.com/apps_cat/indexes but redesign.conei-sa.com/apps_cat this is not..

Sorry for my poor english.

6
  • Use the "view" button (screenshot: prntscr.com/92y1bu) from your taxonomy in backend to get the correct URL. Commented Nov 15, 2015 at 9:19
  • Clicked view button but it's show... this on prntscr.com/92y25f and when i click it will go to this link redesign.conei-sa.com/apps_cat/indexes Commented Nov 15, 2015 at 9:23
  • just make an archive.php, and it will be fine. For taxonomy related template, use taxonomy-{taxonomy_name}.php. Details here. Commented Nov 15, 2015 at 9:25
  • I want two archive . php so how can it be done.. I already have 1 archive.php and taxonomy-{name}.php . Commented Nov 15, 2015 at 9:37
  • Please follow the link I provided, and read first. Commented Nov 15, 2015 at 9:37

2 Answers 2

1

It's not how taxonomy work. The apps_cat is just the taxonomy, not the term. Like category, you will receive not found with http://redesign.conei-sa.com/category. You must point to a specific term of apps_cat. apps_cat can't have any post, only the term of it has.

Anyway, if you got not found with term page, try update permalink structure. Another tip for testing you can try is switching to default permalink while coding to make sure it work, then switch back to pretty permalink.

0

What worked for me for this same problem is to simply change my permalinks to just regular post name structure and update it, which is how my custom post type permalinks looked anyway. I also heard that simply updating the permalinks should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.