Hello I am working on a project where I need to have custom post types. Creating the post types and making them show up in my admin menu was a walk in the park using the following:
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'Portfolio',
array(
'supports' => array('title', 'editor', 'thumbnail','excerpt'),
'labels' => array(
'name' => __( 'Portfolio' ),
'singular_name' => __( 'Portfolio' ),
),
'taxonomies' => array('category', 'post_tag'),
'public' => true,
'has_archive' => true,
)
);
I have created a number of custom posts and all of them get their own perma link.
http://www.mydomain.com/subdomain/?p=123
Resulting in
http://www.mydomain.com/subdomain/?custom-post-type=post-title
However whenever I view this permalink it loads my index.php file instead of the custom post belonging to this link.
The same happens when I try to load http://www.mydomain.com/subdomain/custom-post-type
to access the archive page: it loads my index.php file.
I already tried the following:
- Visiting the permalink setting within wordpress
- Deleting all pages with slug in common width my custom pages
- Deleting all categories with name in common with my custom pages
leads:
- I have no custom taxonomy as far as i know. So I did not register any. I only have a custom meta box with radio buttons being saved to the post meta
- I called:
require_once(ABSPATH .'wp-includes/pluggable.php');
to solve an issue with the post meta
conclusion: I did all this without success. Have been looking for a solution for more than a day now. So i guess it's time to call in the reinforcements. Does anyone have a clue how to solve this and save my day? Thanks in advance!
register_post_type($post_type, $args);
$post_type (string) (required) Post type. (max. 20 characters, can not contain capital letters or spaces)