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/
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/
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
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
Hate to be the bearer of bad news but WordPress hardcodes the Page Template functionality to the “page” post type, at least in v3.0 (that might change in future versions but there’s not a specific initiative I’m aware of to change it yet. So this is one of the very few times I’m struggling to … Read more
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.
As far as I know, WordPress has nothing built in for this, I would just do: filesize( get_attached_file( $attachment->ID ) );
The new user email is sent using the wp_new_user_notification() function. This function is pluggable, which means that you can overwrite it: // Redefine user notification function if ( !function_exists(‘wp_new_user_notification’) ) { function wp_new_user_notification( $user_id, $plaintext_pass=”” ) { $user = new WP_User($user_id); $user_login = stripslashes($user->user_login); $user_email = stripslashes($user->user_email); $message = sprintf(__(‘New user registration on your blog … Read more
Hook onto template_include, set a global to note the template set by the theme then read that value back into the footer or header to see which template is being called for a given view. I spoke about this filter hook before in Get name of the current template file, but go grab a copy … Read more
You could set a global variable during the template_include filter and then later check that global vairable to see which template has been included. You naturally wouldn’t want the complete path along with the file, so i’d recommend truncating down to the filename using PHP’s basename function. Example code: Two functions, one to set the … Read more
Using the generified version of class Class allows you, among other things, to write things like and then you can be sure that the Class object you receive extends Collection, and an instance of this class will be (at least) a Collection.