A great way to make your theme more user friendly is to provide a custom orientation video in the WordPress welcome panel on the dashboard (the top panel on the dashboard):
function st_welcome_panel() {
echo
'<div class="welcome-panel-content">'
.'<h3>Your Welcome Title</h3>'
.'<iframe src="//www.youtube.com/embed/BirQTaTPYwA" height="480" width="854" allowfullscreen="" frameborder="0"></iframe>'
.'</div>';
}
remove_action('welcome_panel','wp_welcome_panel');
add_action('welcome_panel','st_welcome_panel');
We can add an action to the "after_switch_theme" action to restore the welcome panel to all users when your theme gets activated:
function st_welcome_init() {
global $wpdb;
$wpdb->update($wpdb->usermeta,array('meta_value'=>1),array('meta_key'=>'show_welcome_panel'));
}
add_action('after_switch_theme','st_welcome_init');
Comments are closed.