Tag Info

Hot answers tagged

5

WordPress 3.9 introduces a theme_page_templates filter. The example below from a Twenty Fourteen child theme functions.php shows how to remove the "Contributor Page" template: function tfc_remove_page_templates( $templates ) { unset( $templates['page-templates/contributors.php'] ); return $templates; } add_filter( 'theme_page_templates', ...


4

There's a new filter in WP core (3.9) to remove page templates. It can be used from child themes. Here's how to achieve this in TwentyTen (tested on WP 3.9): add_filter( 'theme_page_templates', 'my_remove_page_template' ); function my_remove_page_template( $pages_templates ) { unset( $pages_templates['onecolumn-page.php'] ); return ...


1

You simply need to run your code on a higher priority than what the parent theme is, the default on add_action function is 10 so you can use: function s157343_unregister_widgets() { unregister_widget( 'Chocolat_Widget_New_Entrys' ); } add_action( 'widgets_init', 's157343_unregister_widgets', 20 ); This will unregister that widget. Of course, you can ...


1

Of course right after I post this, I find an answer...so hopefully someone else can benefit from this. For me, the answer was instead of unregistering nav menu items, I needed to just remove the action...so my function now looks like this: function remove_cornerstone_menus() { remove_action('init', 'cornerstone_menus'); } add_action('init', ...


1

Here is what worked: add_action( 'after_setup_theme', 'parent_override' ); function parent_override() { unregister_sidebar('sidebar-4'); /** I have looked for the ID of the sidebar by looking at * the source code in the admin.. and saw the widget's id="sidebar-4" */ register_sidebar(array( 'name' => 'Footer', ...



Only top voted, non community-wiki answers of a minimum length are eligible