Tagged: child theme, Portfolio, remove
In my project I have no need of the Post type Portfolio. So I try to remove it and all its related functions in my child theme like so:
// remove portfolio CPT
remove_action('init', 'portfolio_register');
remove_filter("manage_edit-portfolio_columns", "prod_edit_columns");
remove_filter("manage_edit-post_columns", "post_edit_columns");
remove_action("manage_posts_custom_column", "prod_custom_columns");
These are the first four lines of the functions.php in my child theme. Unfortunately this does not work. A quick check like this
var_dump(remove_action('init', 'portfolio_register'));
always returns false. I know that I could easily comment out the line 396 in enfolds functions.php, but I would rather achieve that from my child theme. Any advices?
add_action( 'after_setup_theme','remove_portfolio', 100 );
function remove_portfolio() {
remove_action( 'init', 'portfolio_register');
}
Try this
Works like a charm. THanks a bunch!