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
- Can a custom post type have a Parent Page?
- don’t publish custom post type post if a meta data field isn’t valid
- How to set a default format for a custom post type?
- WordPress Custom Post Types with a page as a parent?
- Unregister post type from child theme
- Why get_next_post_link() or get_previous_post_link() doesn’t return the required links?
- How often do you need to register_post_type?
- add_rewrite_rule and custom variable
- How to set a custom post type post as static front page?
- With what hook can I address all posts from all custom post types when they are published?
- Delete all the custom post types when deleting user
- Correct way to use a form to to filter custom posts by taxonomy terms?
- Showing current taxonomy terms
- White screen error for a custom theme
- automatically create taxonomy with same name as post title
- Hook when adding or editing a specific custom post type? [closed]
- How can I remove categories in menu in custom post type?
- Restrict categories to a custom post type
- Programmatically adding posts
- Keep main articles and author blogs seprerate, News / Magazine like site
- Sub-Sub-Blogs — creating and importing content into a custom sub-type
- Custom Post Type, Saving Multiple Checkboxes
- Show Two custom Post type and their posts on category page
- How to create an advanced filter search?
- Get rewrite slug of custom post type in template
- Placeholder in HTML editor text area?
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- How to integrate video slide using custom post types?
- Time based access control of custom post types – what is good approach?
- Show titles, date of all posts on single category page
- A form that can save/edit after first input
- Allow users to create posts without logging in?
- Best structure / rewrite rules to achieve the following url
- 404 Error on form submission within custom post type
- Custom URL redirect in WP
- Remove Quick edit for custom post type?
- attach CPT data to a taxonomy
- Displaying multiple post types on home page
- Conflict between wp_list_pages and get_posts – list pages not displaying
- sortable columns for multiple custom post types not working
- How to build a WordPress post review system beside commenting
- WordPress hook after post content and meta update
- Creating a non-hierarchical Taxonomy that behaves like categories
- Separate Content from gallery (custom post type)
- Custom Post type content within a slider
- Displaying a custom post type using get_template_part into a specific layout
- Displaying a list of Contacts
- Different videos for different posts
- Make a custom column sortable by a value from a different custom post type
- WordPress as a frontend website for iOS app [closed]
- wordpress post_where set only for my costum post type
- How can I make custom static widgets/areas on my homepage?
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- custom comment fields on CPT
- Add Class After 4th Post
- Post visibility option to theme front-end for author to select?
- How set template for “custom post type” individual post
- Use Gravity Forms and a Shopping Cart for output to Freshbooks for an Estimate [closed]
- Can I get an auto-populated dropdown list of other custom posts in a custom post edit page?
- How do I ensure that post_type and Taxonomy use the same slug?
- Setting Parent Page to Post
- Question about link two types of data in wordpress
- Custom Form / Search with Custom Post Type Data
- Search for custom field input of a custom post type in ajax live search
- Custom Post Type and Structure Question
- Custom Post Type action on post update
- Show Post Types customized in Template Page
- WordPress next post by ajax call on button click
- Update main post with same category when creating custom post to update the modified date
- Custom post type defaults to index.php for archive page
- customize Dokan multi vendor: how can i set every Dokan as child of another dokan?
- 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?
- Adding specific custom fields (images) to post excerpt
- pricefilter without WooCommerce
- Convert attribute woocommerce terms (taxonomy terms) in posts of custom post type
- Update/publish custom post type with jQuery?
- Is there a best practice, or typical way to do AJAX updating for data on a custom admin screen or post.php?
- Link two different post using there post_id in post meta
- Help with Travel Guide Setup
- Execute code only after user clicks ‘update’ button for CPT being edited
- How do I get a nested query to only display content that the main query outputed
- Add category slug as class attribute in a link array
- Sort by Custom Post Type (Multiple Loop)
- Selecting which pages to display custom post type on using checkbox
- Delete attachment with post
- Get link for feed of specific post type AND taxonomy
- 2 language CPT content
- Is There A Way To Add Another Field To Custom Post Type (Not Custom Field/Meta)?
- Custom post type – columns order
- custom post-type query just returns two posts
- Delete old thumbnail when updating new
- How to automate the creation of advanced layout article/post
- Redirect drafted post of custom post type to URL?