Any advantage to using get_header() over include(‘header.php’)?

Using generic function means throwing out layer of WP API: get_header hook would be gone; compatibility with fetching different headers by name (“header-{$name}.php”) would be gone; usage of locate_template() would be gone, which likely would destroy compatibility with child themes. You can always look at source to see what exactly function does. WordPress uses own … Read more

Change page template programmatically ?

It is possible using the template_redirect hook. Looks something like this : function language_redirect() { global $q_config; if( $q_config[‘lang’] == ‘en’ ) { include( get_template_directory() . ‘/page-template_en.php’ ); exit; } else { include( get_template_directory() . ‘/page-template_de.php’ ); exit; } } add_action( ‘template_redirect’, ‘language_redirect’ ); Code is untested, but should look like that. See my similar … Read more

How can i change email template for new user

For 2018 and onwards users: David Gard’s answer still works but is old and there’s a new better/cleaner way to do this (no need for a plugin anymore). Since WordPress 4.9.0 there are new filters you can use to customise registration emails: wp_new_user_notification_email – customise email sent to User wp_new_user_notification_email_admin – customise email sent to … Read more

How does printf( __( ) ); work?

It’s used for translate text. The second argument is a kind of namespace (called domain here) to retrieve the translation (for example from a dedicated file or something else). So Anyword here, should be the guy behind the template, or the company or what ever that can be a domain/namespace. edit: The doc from wordpress … Read more