You can give this a try.
$template_name = get_post_meta( get_the_ID(), '_wp_page_template', true );
Related Posts:
- different style sheet for just one page template
- Add multiple custom fields to the general settings page
- Define custom Page Template without its own .php file
- Is it possible to remove the “standard” post format?
- Issue with get_theme_mod returning a blank value instead of the saved value
- How to remove row-actions from pages table?
- Modify search function in WordPress (TwentyTwelve)
- How to customize search result page title?
- Auto delete WordPress images/thumbnails (all sizes) and featured after X days/hours, or similar?
- How to fix a theme with page.php Default Template that accidentally deleted?
- Removing Unnecessary Text from Admin Menu without CSS
- Display WordPress Search
- How do I change parameters without changing the core
- Problem with extract() with custom shortcode
- How to add a rel attribute to images that contains their categories?
- Run Product Filter Javascript On Page Template
- add sidebar area to header of child theme
- Preferred Use of home_url()?
- Custom function for user register in wp?
- Programmatically set page template based on page ID
- How to make unique add_filter to the_content of specific page template files – so each template gets its own addition
- Creating loop within functions.php
- How to specify which Gutenberg blocks are available in the editor for a page template
- Refactor create_function
- Filtering posts by category name based on page’s slug
- adding custom classes for tables
- Pass Shortcode Attribute to footer Script
- Customizer field value into functions.php variable
- wp_dropdown_categories and custom attribute
- Automatically wrap multiple images in div
- Ajax not working properly
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- How to customly read JWPlayer’s “Playlist” items by using its “playlistid”?
- Include default functions and methods
- Hard-coding custom menu elements for menu manager
- Twentyten Child Theme: header images display messed up in admin panel
- How can I modify all existing tags while keeping the urls themselves?
- IF Statement on Button to make it complete and “uncomplete” based on user action / click
- Gravity Forms Button Text
- Find resources dynamically loading and change or add to the url
- When sale price is 0.00 show only regular price
- Unable to login using username
- Move Custom Fields on General Settings Page to New Location
- Pass parameter to hooked function using custom page template
- Condition OR for current user ID
- How to retrieve the current post’s generated featured image size?
- Custom Behavior when Adding New Custom Post Type in Dashboard
- Where do I store custom functions that call custom page template files?
- Why There Is No “get content by ID” Function
- Wp-query Order By problem
- Create custom function for hero image
- Randomizing wp_tag_cloud() in child theme
- login_headertitle is deprecated since version 5.2.0
- How to append classname to body tag if guest user
- Where do I go to edit this area? [closed]
- Replace plugin function with a custom function?
- Different favicon on different pages
- Problem with images URL after filter applying
- Function to replace comment’s accented characters before posting
- Insert a field with PREG_REPLACE – strange behaviour
- How to echo Widget Title in Custom Frontend-Template Box
- Page Template Won’t Load Correct CSS File
- loginout function customization
- implementing a centralized content “show-do-not-show” toggle?
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- How to remove font awesome from loading in wp theme
- How to Override Page Template if URL matches query?
- Probleme shortcode with list author
- Save_post – Warning: Cannot modify header information
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- How Can I Create a Friendly Slug for a Dynamic Page?
- Modifying a WordPress Plugin
- CF7 select value get to function and reciept value from function
- Enqueue script if not page template
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- How Can I Concatenate A String With One Of My Custom Field Value Before Saving The Post?
- Woocommerce custom calculation function
- Remove all video attachment, both files and post/postmeta from database?
- WordPress Ajaxifying not working properly
- WordPress function with attribute pass to template
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- Pagination won’t work on custom page
- Replace image attributes for lazyload plugin on image elements with specific class
- Edit meta fields from within template
- Help! Need a different logo on my main page from my other pages
- Display page number on custom page title function
- How to make an If Else on Excerpt Filter
- How to replace words in my posts and saved new words
- Add functionality to post editor
- How to use different jquery function of idangero swiper dependant on page template?
- functions.php / replacing div’s with new ones?
- Why does modifying my functions.php file always result in a server error
- Post variables not displaying correctly in custom function
- Remove snippets of JS from core
- Explode Array from Repeatable Custom Field
- WordPress Custom wp mail template return full template
- How to create a post without link in wordpress?
- post_row_actions filter from parent theme not executing in child theme