Global Parent theme for all sites

Create a separate directory and a (sub) domain for your themes. Lets say the domain is themes.example.com, and the directory is /extra/wp-themes/. Now let all your installations use the new theme root. Or just do the same for plugins to manage all plugins from one place too. Registering a new theme root is not possible … Read more

Removing a Parent Theme’s Menu Items

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’, ‘remove_cornerstone_menus’); Worked like a charm.

Is it possible to override this function/class in a child theme?

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 still create a new class that … Read more

How to use parent theme’s enqueue methods

If the desired functions are in the parent theme’s functions.php then you can include them in your currently executing child theme functions.php with this call: include( get_template_directory() . ‘/functions.php’); get_template_directory() finds the parent’s directory even when using a child theme. Note that this will run everything found to be executable in the parent theme’s functions.php. … Read more

Get parent theme version

In the WP_Theme class, the get method gives you a sanitized theme header. You cannot use it to extract a property. Actually you don’t need to, as you can access it directly like this: // get the parent object $parent = wp_get_theme()->parent(); // get parent version if (!empty($parent)) $parent_version = $parent->Version;

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)