Viewing 2 replies - 1 through 2 (of 2 total)
  • I have the same question.
    I need to apply some filters on wp_head if I’m using a specific template on a single post. Is there a way to check?

    i have some trouble like this and after look in to code of this plugin i have simple function for check what template the post curent belong to. add below function to your functions.php file

    //$templateName is file name of template
    function is_post_template($templateName) {
        global $post;
        $currentTemplate = get_post_meta( $post->ID, '_wp_post_template', true );
        if ($currentTemplate == $templateName)
            return true;
    
        return false;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Return current template in use’ is closed to new replies.