The admin-init
hook only fires on admin screens. The correct hook to use for registering post types is init
.
So change:
add_action( 'admin_init', 'smoelenboek' );
… to …
add_action( 'init', 'smoelenboek' );
… and flush your rewrite rules once (save permalink settings in admin) and all should be well.
Related Posts:
- Custom post type single-{custom}.php not working
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- WordPress giving me the index
- Loop all post on single.php
- Where to put my code: plugin or functions.php?
- Custom post type single page returns 404 error
- Custom post type – order field
- How to put custom post types on front page
- Single custom post type page redirecting to 404 page
- How to set a fall back template for a custom post type in a plugin?
- How to add multiple images to a custom post type single post?
- Disable Single Post View for Specific Taxonomy on Custom Post Type
- Where to put archive-{post-type}.php
- How to get a list of term names of the custom post type im currently on in single.php
- is_singular won’t call my functions?
- Custom Search form not working in localhost
- Group search results by post type, but hide post types with no results
- posts_nav_link on single post template
- Multiple Content Block
- Message on Custom Posts Type admin page
- How do I create an archive page for standard posts?
- Is it possible to associate different kinds of custom post types one to the other?
- Limit users by custom taxonomy and user roles
- Remove parent from custom post type
- Archive page for custom post type not working
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- How to add extra input fields to CPT’s comment form?
- pagination redirecting from page number url before page requested
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- Is it possible to place custom post type files inside a folder in theme directory?
- Posts of custom post type load the page template
- Displaying a custom post types custom taxonomy value?
- Should I use custom menu, C.P.T. or theme options, or something else for this?
- One-to-many post relationships that are displayed by category (using posts-to-posts plugin)
- How do I display tags for a custom post type single page?
- What template files do I need to customise custom-category-term-links rather than fall back on archive.php?
- Get term name and term parent into custom post type permalink
- Custom post type not displaying content from single-{custom post type} page
- Don’t know how to show custom taxonomies from a custom post_type
- Single template showing all posts of that type
- How to change the post type a theme shows by default?
- Event Custom Post Type Title show by upcoming Event Dates
- How to display single post from custom post type loop?
- How to produce a sub-page-system in WordPress
- WebP Fallback for Inline Background Image in Style Attribute
- How to specify a template for a path like http://example.com/something?
- single-{post_type}.php not working
- How can i link a custom post type thumbnail to intermediate size
- i cant see the max_num_pages of a custom wp query
- Archieve.php not loading for custom post type
- Associate page w/ specific single post template?
- Display custom post using ID
- Specify a particular page to list all custom types
- Where is the sticky post option?
- Custom post type permalink sends to 404.php
- WP_Query with custom post type ID
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Can’t access private custom posttype single- or archives-page
- Custom Post Type – after disable ‘Add New’, I can’t edit and delete post
- Searching post types
- Add admin script to several post types
- Why does my URL keep returning 404 error code?
- Custom post type posts wont show in wp_nav_menu()
- How to exclude categories from a sidebar with active widgets in it?
- Creating an option for writing a post without an author attribution for a group blog on WordPress
- Give active class to current page on a while loop WP query for custom post types listing
- Get next and prev item from custom WP_Query and Custom Post Type
- Page not found on custom post type page for projects
- Error 404 change permalink term custom term taxonomy
- Post template not applying on theme (potentially rendering as Page template)
- custom post type – project link output via single-portfolio.php
- How to search through all child taxonomies using WP_Query?
- Custom Post Taxonomy Template Not Loading Properly
- Shortcode and get_template_part
- How to display only child category post in related posts in custom post type?
- Create dynamic logo carousel without using any plugin
- How to make “single post” permalink maintain it’s sub-page structure
- Links Image in “Catalog” Page to Posts
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- WordPress is giving a warning but my code is working fine
- Not Able to Get Custom Post Type in Single and Single-custom-post-type
- How to set class to “current-page” on the currently viewed single post within a CPT
- How to develop custom URL redirection
- How to display category wise posts on seprarate template
- Using piklist meta box, strange behavior
- Cant insert wrapper div into index.php
- Pulling in Related Posts based on Post Type array
- show custom taxonomies in hierarchy
- How can I detect a chosen Isotope layout option from within Javascript to generate appropriate layout?
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- how to load custom single.php?
- Function that get ACF fields value before saving
- Conditional Tags If Custom Post Parent & Child?
- Create custom post order (with custom post type meta)
- Change position of Post Formats box?
- Single page for Custom Post Type not found
- How to manage wordpress knowledge base/wiki/posts collections
- Need some hints for my own WP theme development
- Show custom post type on post category page doesn’t work / breaks navigation
- WordPress Multisite Network Shared Custom Post from Main Site using single-CPT.php