Cannot apply custom css to IE in the theme

Looks like TwentyFourteen includes the ie.css stylesheet within a ‘less than IE 9‘ conditional tag, which would explain why it’s not working for IE11. <!–[if lt IE 9]> <link rel=”stylesheet” id=’twentyfourteen-ie-css’ href=”http://localhost/wordpress_answers/wp-content/themes/twentyfourteen/css/ie.css” type=”text/css” media=”all” /> <![endif]–> Sounds like you’ll want to enqueue your own IE specific stylesheet. This is probably done cleanest from within a … Read more

How to get theme screenshot

You can use WP_Theme::get_screenshot() method, which returns the screenshot url. For example: $themes = wp_get_themes(); foreach( $themes as $theme ){ echo ‘<img src=”‘.esc_url($theme->get_screenshot()).'” />’; }

How to switch theme if the current user is admin?

You are sort of doing this in a roundabout way. WordPress has a function called switch_theme(): add_action( ‘setup_theme’, ‘switch_user_theme’ ); function switch_user_theme() { if ( current_user_can( ‘manage_options’ ) ) { switch_theme(‘twentytwelve’); } else { switch_theme(‘twentythirteen’); } } The argument is the directory of the theme you want. I can’t help but think this is a … Read more

WordPress root directory change + Theme directory change

You can move the installation and also plugin and content folder. The follow source demonstrate this. //* // Custom content directory define( ‘WP_CONTENT_DIR’, dirname( __FILE__ ) . ‘/wp-content’ ); define( ‘WP_CONTENT_URL’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/wp-content’ ); // Custom plugin directory define( ‘WP_PLUGIN_DIR’, dirname( __FILE__ ) . ‘/wp-plugins’ ); define( ‘WP_PLUGIN_URL’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . … Read more