Query variable only can be accessed after wp_query
has been called. In you call, the get_post_type()
function is actually returning an empty value. It should be working, if you change the hook to something which fires after wp_query is called.
So, You should use –
add_action('wp', 'kiwi_remove_post_author_box');
OR
add_action('template_redirect', 'kiwi_remove_post_author_box');
Also, hooks can removed with the same priority value the have been added on.
So final code it would be –
add_action('template_redirect', 'kiwi_remove_post_author_box');
function kiwi_remove_post_author_box()
{
if( is_singular('wpseo_locations') )
remove_action( 'woo_post_inside_after', 'woo_author_box', 10 );
}
Related Posts:
- How do you use a CPT as the default home page?
- Admin Post Update Redirection to Posts Screen
- Categorise Custom Post Types
- Add an Outside Wrapper to my Header and Make it Full Width
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- How to check post type (to include custom css)
- How to customize a permalink (URL) structure?
- Plugin: register custom post types, child ready and performance best practices
- Display only one post each WEEK
- How to Mass Delete Images from Media Library
- Posts are duplicating on wp_post_update
- Permalink structure by Post Meta value
- How to integrate video slide using custom post types?
- A question on creating filters for custom posts using taxonomy
- Conditional Query of Custom Post Type and custom taxonomy
- will post_id ever change? Can I safely use post_id for custom queries?
- List custom taxonomy specific to one custom post type
- Define new user capability for custom post types?
- How to allow visitors to enter custom post type?
- Is it possible to create relational metabox values in a custom post?
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- Meta query for custom post type ignored in main query
- 2 Templates 1 custom post type according url
- How do I move/order posts with a tag to the end?
- changing meta value and meta key of price field
- WordPress sort search results by custom order
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- Hide parent categories when clicked, and show it’s childs
- Custom Path/Folder behind a custom post type
- Time based access control of custom post types – what is good approach?
- Show titles, date of all posts on single category page
- delete_published_posts does not work
- How to start a new post with custom Taxonomies already set?
- WooCommerce sort products by the actual product width(not the shipping width)
- Create a custom php page and load it at a specific slug
- Structure of data : CPT + terms
- Limit number of custom posts per taxonomy
- How to handle paged param in post and custom-post-type?
- Default text in a specific post type, but not visible?
- Update postmeta Parent when post_status child change
- WP_Query custom post type query not showing the exact post type
- Shortcode to display Staff post type based on Location post type and Specialty post type
- How to remove post listing page for a custom post type
- How to include term custom meta into the custom taxonomy term permalink structure
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- A form that can save/edit after first input
- Adding the_content() in custom template email
- Cannot save CPT meta box
- non-hierarchical post type with hierarchical url structure
- Send notification to the admin when new custom post is submitted
- How do i search authors from search form using author’s name
- Allow users to create posts without logging in?
- How to add attributes to taxonomies that may be different from post to post?
- Pages are not saving due to custom post type
- Filter Posts from the Main Query
- Migrating a taxonomy’s tags to the native category
- How to produce a sub-page-system in WordPress
- Best structure / rewrite rules to achieve the following url
- don’t publish custom post type post if a meta data field isn’t valid
- How does order=asc effect a wp_query (its acting pretty weird in a loop)
- How to sort posts in a custom post type by title in ascending order by default?
- How can I add a filter to a particular post format?
- Is there any way to get list of all possible filter hooks for all post types?
- Detect inside a custom query the kind of post type to assign custom classes
- Add a custom text to admin footer in a Custom Post Type page
- custom post type vs. conditionally displaying meta boxes for specific terms?
- Edit the_content() function so to add a div wrapper
- How do you make a custom post type items automatically delete items 3 months after publication?
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- Number of posts in the archive
- custom post data – how to
- Ordering Submenu Pages in WP 3.1
- 404 Error on form submission within custom post type
- Get rid of “trash can” for custom post type
- Custom URL redirect in WP
- Remove Quick edit for custom post type?
- Replace dynamically content in a custom database table when a custom post is created
- How to customize work area / admin area in a custom post type without plugins?
- Use remove_meta_box conditionally on custom post type
- How can I have different content for different countries?
- Change “empty trash” button text?
- Custom Meta fields Update hook?
- How to display custom field value on page?
- wp_trash_post action hook with custom post type
- How do I amend form data before it is saved for a custom post type
- Move Genesis Single Page/Single Post Title
- List Categories (wp_terms) and count posts
- attach CPT data to a taxonomy
- Displaying multiple post types on home page
- Get_the_terms restrict output
- Conflict between wp_list_pages and get_posts – list pages not displaying
- Custom post type menu
- sortable columns for multiple custom post types not working
- How to insert data into meta box from another plugin?
- How check if a post is saved from backend or frontend?
- why post_class() function apply css classes to all other files?
- WordPress custom API endpoint – how to make the request more flexible
- How to build a WordPress post review system beside commenting
- WordPress hook after post content and meta update
- ACF for custom post type archive pages: which hook to use?