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:
- Specific routing for CPT
- Top Level pages in wordpress giving 404, but child pages working fine
- Query posts with double taxonomy
- CPT category hierarchy
- How To Import CPT With Only Few TEXT ACF Fields From Front End?
- Add a custom text to admin footer in a Custom Post Type page
- Get only used meta_values
- wordpress remove views from action links in a custom post
- Custom Rewrite Rule for Custom Post Type with URL Param
- Displaying a Custom post type per day
- Getting 400 Bad Request on AJAX Call
- Remove Quick edit for custom post type?
- WordPress custom slug rewrite
- How do I create an overview page with custom calculations from a post-type?
- Setting Post Title via Meta Data returns Auto-draft
- Not sure why this template for custom post type posts isn’t displaying anything. What’s missing?
- Creating two loops based on different logic
- Plugin or method of allowing user to rearrange custom post types with drag and drop?
- I want to know if i can add two different custom post types to my wordpress site
- Add to ‘action’ within post.php to allow more actions when editing a Custom Post Type in a plugin
- Archive links for custom post types
- Run shortcode in custom script in wp_head if post type is CPT ‘Jobs’
- Custom permalink not working and showing 404 page not error
- Query entries from custom post type in an ACF flexible content field
- Custom Post Type (CustomPress) [closed]
- Direct form to a custom page template
- How to create a template to show child terms of a MAIN taxonomy
- How to copy a custom field from the user’s CPT to the user’s normal posts
- Different videos for different posts
- How do I add new post formats to twenty fourteen theme?
- Related posts meta_query CPT
- Problem On Retrieving Post Meta Data on Custom Column [closed]
- Shortcode is displaying the wrong post_title
- Enable comments for post when comments meta box removed
- Post visibility option to theme front-end for author to select?
- Custom Post Type page template doesn’t show up
- Custom MetaBox : Food Menu Item Available Dates
- Sorting the Loop by Taxonomy Value
- CPT : Next or Previous term link when has not adjacent post
- Admin Posts Table Filter
- Custom taxonomy, post type, and URL permalink structure
- Getting Same Description in All the Custom Taxonomy Posts
- How to specify user ID for a CPT wp_insert_post when there’s no actual user (it’s programmatic)
- Added new role with custom capability. But cannot access the page
- Check that a slug is present in the get_terms request
- Permalink for specific post type
- Update main post with same category when creating custom post to update the modified date
- I have a random letter appearing before my content. Where to start looking for the cause?
- custom post types, custom fields and normalization
- Problem in moving cpt’s from local website to live website
- custom post type single page not found after aotumatic publish By the author’s robot
- Static blog / posts page issue
- How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?
- Taxonomie cpt with acf
- How to display custom post type pagination buttons when processing AJAX request
- Showing a different logo for a custom post type
- How to replicate data storage and querying using WordPress. Custom posts/fields or Custom db tables?
- CPT: execute code after load if parameter is set
- Query for a custom post taxonomy
- Multiple domains, Single database, 1 Parent/Master with all content, other domains/slaves with filtered content (based on “location” variable)
- Making Custom Posts behave like pages
- Creating connections programmatically with common fields on CPT’s
- create wordpress user on custom post type publish
- How to Fix WordPress 500 Internal server error due to custom post type
- jQuery tab_title already in use
- How to show other custom post type other than current post type in a single.php
- Customising the admin columns for a custom post type, but now most of the built in categories don’t display?
- How to get Last post Id of custom post type in wordpress
- Attach a custom post type archive to a static page
- Get list of CPT posts in *current* post’s taxonomy term
- Custom post type child page 404
- Sort by Custom Post Type (Multiple Loop)
- Costum post type with costum (sub)taxonomy
- Display a post count from a custom metabox selection
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- WordPress Custom Permalink Structure with Custom Post Type and Taxonomies
- Tags results not displaying for post types
- Problem querying new custom post type while old display fine
- Trying to combine multiple WordPress queries
- Make future posts visible to the public—not just within WP_Query
- Custom taxonomy archive page not routing?
- 2 language CPT content
- preselected custom fields in custom post type
- get_the_term_list() wanting to loop through the returned values
- Adding custom shortcode to page leads to page without styling
- Display tags & categories seperatly
- Display a list of posts whose meta field values are equal to the ID of the post being viewed?
- Adding post_type to the query via pre_get_posts, with infinite scroll
- Shortcode in a page to display custom posts which also have a shortcode in them
- Adding some HTMl code as posts doesn’t work but it does if it is added directly in the file?
- How to add custom settings to the menu of custom post types?
- Custom post type split title, setup permalink accordingly
- Admin menu link with variable
- Modifying post_type_link hook messing up edit function for a custom post
- Two Permalinks with one Taxonomy (custom taxonomy) and (custom post type -> custom taxonomy)
- Custom post type template not loading from plugin
- Create side bar widget showing list of years as hyperlinks for a custom post type
- Detach WordPress Media Files In Bulk
- Can’t retrieve custom post type taxonomy term to custom post type editor
- Add taxonomy or category slug to custom post types URL