0

I've created a custom post type:

   $args = array(
    'labels' => array(
      'name' => __( 'Prosjekter' ),
      'singular_name' => __( 'Prosjekt' ),
      'add_new' => __('Nytt prosjekt')
    ),
    'public' => false,
    'show_ui' => true,
    'show_in_menu' => true,
    'has_archive' => false,
    'taxonomies' => array('category'),
    'menu_position' => 5,
    'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes','post_tag' ),
    'rewrite' => array('slug' => 'prosjekter')
  );
 register_post_type( 'project',$args);

Then I've created this template file:

single-project.php

But when I open a project it's not using the template. What am I missing?

1

Change public to true. Else if not to be public then I'm not sure you can use or need a template. If you do need some sort of interface for administrators that works via theme. Then I think you need to set public to true and use other values to prevent public querying etc

See Wordpress.org http://codex.wordpress.org/Function_Reference/register_post_type

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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