Hi,
you need to create the archive page and the single page for the custom post type and taxonomy used by our plugin.
Hi thanks for your help! This worked. For anyone else here’s the code: (add to funcitons.php) create single-sln_service.php if you wish.
function custom_post_type()
{
register_post_type('sln_service',
array(
'labels' => array(
'name' => __('nail services'),
'singular_name' => __('nail service'),
),
'public' => true,
'has_archive' => true,
)
);
}
add_action('init', 'custom_post_type');
add_action( 'init', 'custom_pages_tax' );
function custom_pages_tax() {
register_taxonomy(
'sln_service_category',
'sln_service',
array(
'label' => __( 'Nail Category' ),
'rewrite' => array( 'slug' => 'sln_service_category' ),
'hierarchical' => true,
)
);
}
-
This reply was modified 7 years ago by
wisebro.
-
This reply was modified 7 years ago by
wisebro.
in the end this code worked for me. Hope it helps anyone
function custom_post_type() {
register_post_type( 'sln_service',
array(
'labels' => array(
'name' => __( 'Nail Services' ),
'singular_name' => __( 'Nail Service' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'sln_service'),
'taxonomies' => array( 'sln_service_category' ),
)
);
}
add_action( 'init', 'custom_post_type' );
//Register new taxonomy DEAL TYPE MC
function custom_pages_tax() {
// create a new taxonomy
register_taxonomy( 'sln_service_category', 'sln_service',
array(
'label' => __( 'Nail Categories' ),
'rewrite' => array( 'slug' => 'sln_service_category' ),
'capabilities' => array(
'assign_terms' => 'edit_posts',
'edit_terms' => 'publish_posts'
),
'labels' => array(
)
)
);
}
add_action( 'init', 'custom_pages_tax' );
Hi since creating the custom post type and taxonomy the direct booking link no longer works
Hi the problem with the direct booking link was solved when i upgraded to the latest vertsion