I have aj-fashions custom post type. technically i tried to show the loop of all post in a template file named fashio-template.php and now for the single post i have created file single-fashions.php. still i am getting 404 error of page not found.
Kindly advice, following is my code.
add_action( 'init', 'fashion' );
function fashion() {
register_post_type( 'aj-fashion',
array(
'labels' => array(
'name' => __( 'AJ Fasions' ),
'singular_name' => __( 'AJ Fashion' )
),
'public' => true,
'has_archive' => true,
'show_ui' => true,
'hierarchical' => false,
'rewrite' => array('slug' => 'aj-fashions',),
'supports'=> array( 'title', 'editor', 'thumbnail', 'author' ),
)
);
}
After creating single-{posttype}.php You just update your permalink. Got to Settings->permalinks. First time every developer face this problem.
After creating single-{posttype}.php You just update your permalink.
And this not worked than use this function
Put in functions.php flush_rewrite_rules( false );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With