If I understood correctly, all you have to do is add 'publicly_queryable' => FALSE,
to your arguments array.
And the individual archive template file would be archive-kalendar_radova.php
, that’s right.
// Edit
In order to have a single view of your CPT be redirected to the according archive, put the following to your functions.php
file:
function wpdev_169737_redirect_single_cpt_to_archive() {
$post_type="your-cpt-here";
if ( is_singular( $post_type ) ) {
wp_safe_redirect( get_post_type_archive_link( $post_type ) );
exit();
}
}
add_action( 'template_redirect', 'wpdev_169737_redirect_single_cpt_to_archive' );
Related Posts:
- Custom Post Type, WP_Query and ‘orderby’
- List custom post types in dropdown
- Renaming Menu Item within Admin Menu Section for a Custom Post Type?
- Render a different post/template from within the template_include action?
- Numeric pagination custom post type
- Categories under custom post types doesn’t show properly
- Custom templates for posts like for pages: page-{id} vs single-{id}
- get a list of posts from Custom Taxonomy
- Custom post type archive sorted and grouped by date in post meta field
- Comment moderation on custom post types
- How to set default status to custom post type
- Is it possible to display post title in reverse word order?
- Quickest way to get last or oldest post date – WP Query
- Custom post type and taxonomy permalinks – Structure
- Best action hook to create custom post and assign taxonomy terms to it on plugin activation?
- Adding class to featured image
- How to redirect wp-admin/index.php to a custom post type?
- How many Custom Post Types to register?
- Add a label to the editor?
- How to get the post type from a category id?
- Custom Post Type won’t Register
- Query custom post type by category slug
- Is it possible to show full content of the post when there is only one post in a grid?
- Insert & order custom post types in/as submenu
- How to bulk copy custom fields between custom posts?
- Get image post ID in media upload
- Turn on and off custom post type from admin?
- How to make this menu drop down or like accordion
- Multiple meta_values in the pre_get_posts filter?
- Get posts between custom dates
- Search / Filter posts on Title/Content OR Tags
- How to get post type and month/year before while loop for date.php file
- Several post types on WP Query by tag and taxonomy
- School & class blogs: Categorize with categories or custom posts?
- Custom Postype specific changes in admin panel
- Custom Post Types vs. Advanced Custom Fields (with Repeater Field add-on)
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Display and register custom categories for custom post types
- Warning: Invalid argument supplied for foreach() in post.php [closed]
- Adding predefined terms to a taxonomy
- How can I group posts by months and years?
- Custom post type – list posts based on meta_key and display them divided by CPT taxonomy category
- Get $post->ID from a URL
- Redirect to archive is single post has a certain term assigned to it?
- Displaying a div from an assigned meta_value when on a page
- Saving fields in a drop-down in WordPress
- Custom taxonomies to define versions of a product
- why is the current page title being output?
- Proceed to the next video of the custom post type but remain on the same post
- Post URL based on Custom Post Types variables
- WP_Query not resetting after wp_reset_postdata
- How to show the current category of an article with CPT UI
- How to show custom field on specific custom post type posts only when filled
- duplicate comment section functionality and call it something else for custom post types
- Custom Endpoint For Custom Post Type from Child Theme
- How to prevent meta data from being edited in a post?
- Getting WordPress to store 0 values for custom post type meta
- How to add href=”” custom post type?
- Add filter to Admin list for all custom post types by their custom taxonomies
- Single.php for Custom Post Type > Taxonomy > Term
- Custom post types templates
- prevent sub categories to show up
- WP Query from two Custom Post type fields as statement
- Save data is post using php front end
- Custom Post Type Archive Page showing as 404
- Cannot include custom post item within a menu
- Custom page with no headers, footers and its own CSS, Javascript
- Custom Post Type Single Page and Archive Page redirects to Home Page
- How to sort by multiple values in a nested WP_Query
- Videos Post Type with Custom Filters
- Pull 2 different custom post type with 2 different WordPress into external website
- Multiple Custom Post Type in Taxonomy Archive Causing White Screen
- Adding a Section for Visitors
- Use output of wp_dropdown_categories($args)
- How to Create Single template for custom post
- If thumbnail image else post title
- How save custom meta type posts multicheck grouped by taxonomy (with CMB2) [closed]
- Different Configuration for the_excerpt()
- Add filter button to custom post type in admin area
- SQL LIKE in WP_Query
- How to load custom post type plugin after acf options page (or get settings from there another way)?
- Simple renaming my custom post type set with a plugin doesn’t work?
- can’t see categories in appearance-menu-categories
- Associate custom categories to different user IDs
- Cant move file after media_handle_upload
- Different read-more link for each custom post type [closed]
- archive-{custom_post_type}.php not getting recognized wordpress
- Comments not enabled for custom post types
- How to retrieve the permalink for a specific (custom) term?
- Meta-Box to add multiple items one at a time and on publish save all
- Values inside a custom field to determine which category posts to display
- CPT, Custom User Role and problem with user manager
- How to rewrite CPT-Permalinks the correct way (incorporating meta-box-data)?
- Checking for published posts in a certain post type
- Allowing logged in users to create custom posts
- Custom Post Type and single-posttype template
- Custom post type as a category, for another custom post type
- Code to show related posts (custom post type and custom taxonomy/category) is messing with other code
- register_term_meta not working
- show posts under custom post type with same autj