problem including page template

I think you meant to use: get_template_directory() Codex: Absolute path to the directory of the current theme (without the trailing slash). (link) instead of: get_template_directory_uri() Codex: Retrieve template directory URI for the current theme. Checks for SSL. (link) if you’re using include() for PHP code. But you should rather consider using: get_page_template() Codex: Retrieve path … Read more

Template Include crashing browser

You have a couple mistakes in your code: is_archive() does not accept any parameters is_archive() does not accept any parameters. If you want to check if this is the archive of a custom post type, use is_post_type_archive( $post_type ) Instead of using include( plugin_dir_path( __FILE__ ) . ‘my-template.php’);, use dirname( __FILE__ ) . ‘my-template.php’; Single … Read more

Get template name by full URL

You can make use of the global $template which holds the complete path of the current template being use to display a page. From there you can manipulate the value to get the name of the template As example, the value of $template looks like this: (This is on my localhost on my PC) E:\xammp\htdocs\wordpress/wp-content/themes/pietergoosen2014/page-test.php … Read more