• When I go to permalink of individual post under my custom post type (nira_blog), I get the 404 page. i have single-nira_blog.php and single.php uploaded.

    Also, Im filtering smart archives reloaded to only show custom posts, but when i hit link to certain months, it defaults to archive.php instead of archive-nira_blog.php, which is upoaded.

    here is the function in functions.php

    add_action('init', 'create_post_type');
    function create_post_type() {
    
      $nbargs = array(
            'label' => 'Nira Blog',
    		'has_archive' => true,
    		'taxonomies' => array('category'),
    		'show_ui' => true,
    		'public' => true,
    		'publicly_queryable' => true,
    		'query_var' => true,
    		'menu_position' => 5,
    		'rewrite' => array('slug' => 'nira-blog', 'with_front' => false),
    		'supports' => array('title','editor','author','thumbnail','excerpt','comments')
    
      );
      register_post_type('nira_blog', $nbargs);
    }

    single templates are just the normal templates. here is the main loop with the permalink that goes to 404 page

    [Code moderated as per the Forum Rules. Please use the pastebin]

    `
    Please help!
    Thank you

  • The topic ‘Custom post type permalink not finding single or archive templates’ is closed to new replies.