What parameter should I pass to wp_enqueue_style to depend on the themes stylesheet?

First issue – you have dependency backwards. Depending on something means loading after dependency, while you want earlier. Second issue – theme’s stylesheet doesn’t actually use enqueue, it is usually codded directly in header.php file of theme. And since it seems to come before wp_head() call – you have no hook to ensure your stylesheet … Read more

add a class when login

If you are using the body_class() function, a class admin-bar will be added automatically when the admin bar is active. For example: <body class=”home blog logged-in admin-bar”> You can then use that class in your CSS to specify specific rules: .admin-bar .Div1 { /* custom styles */ }

Extend a class plugin

This works for me: class father { var $user; function __construct() { add_action( ‘init’, array( &$this, ‘set_user’ ) ); } function set_user() { $this->user = wp_get_current_user(); } } class child extends father { function __construct() { parent::__construct(); } function user_id(){ return $this->user->ID; } } $father = new father(); $child = new child(); add_action( ‘admin_notices’, ‘test_stuff’ … Read more

Change template dynamically

Just in case someone comes here to copy pasta without looking at the codex. THE APPROPRIATE FILTER IS »template_include« See: Codex – Filter Reference As Radek pointed out that method can destroy your theme. Additional information: The article »Don’t use template_redirect to load an alternative template file« by Mark Jaquith, where he says, in a … Read more