How do you access the Product Short Description in a WooCommerce email template? [closed]

I finally tried using var_dump() on $item and $_product, which are both used in the email-order-items.php template. $_product revealed a post object, which itself has a post_excerpt property, which looks like it holds the contents of the “Product Short Description” from the WooCommerce product form. So, to add the description beneath the item name, I … Read more

What’s the purpose of the paged.php file?

If we look in template-loader.php, we can see the conditions under which paged.php will be loaded: if ( defined(‘WP_USE_THEMES’) && WP_USE_THEMES ) : $template = false; if ( is_404() && $template = get_404_template() ) : elseif ( is_search() && $template = get_search_template() ) : elseif ( is_tax() && $template = get_taxonomy_template() ) : elseif ( … Read more

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 ); ?>

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

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

Is there any way to use get_template_part() with folders?

In fact you can, I have a folder in my theme directory called /partials/ in in that folder I have files such as latest-articles.php, latest-news.php and latest-statements.php and I load these files using get_template_part() like: get_template_part(‘partials/latest’, ‘news’); get_template_part(‘partials/latest’, ‘articles’); get_template_part(‘partials/latest’, ‘statements’); Just dont forget to omit the .php from the file name.