You load files on init, and your loaded file hooks something to init. At the point the file loads init has already happened, you’re adding the action too late. Just load the files outside of a function and make sure anything in those files are hooked to the proper action.
Related Posts:
- What does this PHP function code mean? [closed]
- How to disable the single view for a custom post type?
- How to set a custom post type to have viewable future posts
- Custom post type pagination 404 fix?
- How do I append multiple taxonomies to the URL?
- Post revisions don’t save or show up only for custom post types
- Building a Digg clone using WordPress?
- Setting Default Category for Custom Post Type Upon Autosave
- Creating relationships between multiple content types [closed]
- Multiple Single Post templates
- Only list categories that contain posts of a specific custom post type
- How to filter custom post type archive by meta value
- Add/overwrite a parameter on an existing post type/taxonomy
- Get the ‘slug’ of a custom taxonomy
- post_type_link filter causes 404 on the CPT page it’s used on
- How can I get next post id after current post id for custom post type
- Term Checklist Walker – Disable Parent Categories
- Show certain terms from custom taxonomy but exclude ‘parent’ terms?
- Add special meta box to custom post type
- Custom Taxonomy conditionals
- Possible to change the slug of default post type?
- Help with issues on “Adding a Taxonomy Filter to Admin List for a Custom Post Type?”
- How to create archive page for taxonomy terms within custom post type
- Function tied to woocommerce_payment_complete_order_status blocks “processing” order status
- List terms from Custom Taxonomy
- Multisite Global Custom Posts
- Custom post type – posts list – white screen of death
- WP-Admin edit.php & post.php slowdown after import of 10k users
- Set a default category – if the user didn’t select one- before creating a post
- Set object terms not working on plugin activation
- Display only post types that are direct children of the current taxonomy
- Pass the_post() as a parameter
- Plugin templates in which directory
- Add custom parameter to REST API request of a custom post type?
- Getting the URL of the parent page
- Custom Taxonomy Invalid in REST API
- How to Display child post on his parent post with thumbnail and content in WordPress
- Append date to custom post type url slug
- Custom Post Type Archive Page Filtering
- How to move image thumbnails into custom folder for custom post type
- Use menus with anchors
- Missing Posts in Custom Taxonomy List
- Custom post content to display in a normal post?
- Insert Custom Post Type data from the front-end by a user
- displaying featured image url of custom post type in image tag
- Permalinks /country/city/cpt/postname/
- Seamless permalinks between Custom Taxonomy and Custom Posts
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- Path to custom post type
- Multisite: How to define and limit a Custom Post Type to specific sites?
- How do I share categories across multiple post types?
- How to add multiple markers on the google map, at a certain meta_key and meta_value
- Why is my WP_Query outputting my entries twice?
- Optimise WP custom post type query
- Custom Post Type with Custom Taxonomy as Category
- WP_Query() with custom post type and taxonomy — get all terms?
- Custom Post Type conflicting with page?
- How do I get the custom category URL from the custom post type?
- Associate all Custom Post Types with Taxonomy
- Custome fields not displayed
- Is it possible to use array_walk() to append terms to an array of posts?
- wp-json API: not logged in when clicking link to the API from admin mode
- Custom post types, disable fields
- Custom Post Type Custom Archive Page Not Working
- Enabling permalinks disables custom page template
- Easier way to display custom post meta?
- pre_get_posts works in post type archive but not in single post
- Copying over taxonomy structure from one CPT to another
- Disable permalinks, but allow RSS feeds
- set_object_terms action hook based on the function in the published CPT
- How to limit the number of custom posts certain users can publish in WordPress using php script?
- Changing CPT permalink
- Using wp_insert_post for one custom type inside another custom post types’s save function – big problem
- Issue on Getting URL of Uploaded Image to a Custom Post Type
- Load custom post type with ID in a shortcode
- Missing permalink for custom post type
- Error when moving custom post type to bin
- Custom post type and taxonomy same slug
- filter the title changed also the page titles
- automatic creation of custom post type articles
- Columns depending on posts count
- How to Show all Values in category.php page using post_type
- Decrement term in for each
- WordPress custom post type advise
- Custom Post Type and Taxonomies, creating the corresponding template file and loop the data
- Excerpts and Custom Post Types
- Redirection error after posting a comment on a custom type post
- Redirection loop error after login from a custom post type post
- Having some trouble properly displaying Custom Post Types in templates
- Get term_id for each instance of custom taxonomy
- Customizing the display of custom post types
- Using predefined html in new posts
- install.php Custom Taxonomy Term not being added to custom post
- How to retrieve taxonomy terms of the current custom post?
- WordPress search results grouped by post type
- coloring row’s background based on custom field value
- Cannot create custom post types with a specific name
- REST API callback function is not called
- How to create download page with countdown in wordpress?
- Change the WordPress database prefix on the fly?