• I can’t get my produkt.php to work, and understand there’s something wrong with my page slug.
    I tried archive-produkt.php and produkt-archive.php and several other names.

    This is the code in my functions.php, so if someone understand what’s going on here I will send you a virtual flower.

    // Register Custom Post Types
    add_action('init', 'register_custom_posts_init');
    function register_custom_posts_init() {
        // Register Products
        $products_labels = array(
            'name'               => 'Produkter',
            'singular_name'      => 'Produkt',
            'menu_name'          => 'Produkter'
        );
        $products_args = array(
    	'slug' 		     => 'produkt',
            'labels'             => $products_labels,
            'public'             => true,
            'capability_type'    => 'post',
            'has_archive'        => true,
            'supports'           => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions' )
        );
        register_post_type('produkt', $products_args);
    }
Viewing 1 replies (of 1 total)
  • Hi,

    Please clarify:

    I can’t get my produkt.php to work

    What do you mean by this? The code is not working, the archive list is not working, etc? What is your desired outcome?

    I tried archive-produkt.php and produkt-archive.php and several other names.

    With what code in it? Again what is it that you are trying to do?

    If you are trying to get a list of archived produkt posts, have you tried /produkt?

    Please note that if you want an archive list by url, you do not type in the .php as part of the url.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Post Type Slug Problem’ is closed to new replies.