Use [embed] filter in template files

Use wp_oembed_get( $url ) instead. Make sure you echo it in your template file. So, something like this: <?php // tot necessary to set this but good if $url is coming from a function $url=”https://www.youtube.com/watch?v=jofNR_WkoCE”; // echo the function in your template to render the video echo wp_oembed_get( $url ); ?>

Enable page templates. How?

Chances are that the theme you’ve switched to has no page templates defined – they exist on a per theme basis. Here’s the Codex reference: https://wordpress.org/support/article/pages/

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

Return HTML Template Page with PHP Function

Something I forgot in my previous comment was that shortcodes return content, both the suggested include and my alternative get_template_part will directly output the content (which is what you are seeing with the content appearing at the top of your page instead of where the shortcode is called). To counteract this we must use output … 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

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