This should do the trick for you. This shows what template file is stored in post_meta
, if one has been selected in the admin panel:
$template_name = get_post_meta( $the_query->post->ID, '_wp_page_template', true );
If you want to see if the page is the homepage, use is_home()
or is_front_page()
.
If you want to see what files are generating the page, use this in your functions.php:
// Returns a list of files used to generate the page. Best called in footer.php before </body>
function _dump_files()
{
# @todo Aufrufende Datei kann im Array manchmal fehlen!
add_action( 'all', create_function( '', "echo '<pre>'; print_r( get_included_files() ); echo '</pre>'; return;" ) );
}
I use it in footer.php
like this:
if (is_user_logged_in()) {
_dump_files() ;
}
Related Posts:
- How can I create a meta_query with an array as meta_field?
- How can I query all users who registered today?
- WordPress creating excessive joins on meta_query with search
- How to display liked posts of current user in wordpress?
- How can I apply a meta query for a single custom post type in the main query?
- How to check current user in meta value array in WP_Query meta_query
- Using pre_get_posts to target a query in the sidebar
- Query metas (and not : query posts by metas)
- How to orderby multiple meta fields with another meta query
- Query returning same results even though the ID changes
- Order by meta value pro first then meta value free in my search function
- get_users with array as meta_value
- get_post_meta with WP_query
- WordPress Mysql query and Duplicate
- How properly create a blog template for wordpress?
- How to “orderby” the first array in a meta_query that uses multiply keys?
- meta_query not working
- WordPress query: merge meta key (number) values and sort
- Restrict WordPress search to a single ACF field
- Is there any way to get all custom posts and all custom terms with it’s meta in few queries?
- Fastest and most efficient SQL query to check if UID exists
- Query Posts that have or don’t have a meta_value and order by the same ASC
- What is the best way to query posts based on live data?
- list or get meta_key where meta_value is ‘something’
- WP_Query orderby meta key/value suddely stopped working
- Meta Query compare with LIKE pulls similar post types: 55 and 155, and 1,155
- How to Optimize WP site for millions of posts
- Get Terms by IDs with IDs order
- How many WordPress SQL Queries per page?
- Slow wp_enqueue_media()
- Advanced Custom Fields – Query Efficiency
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- How to display lastest post date in the homepage?
- How to tell if $query_var isset?
- Sorting Grids with Essential Grid and Events Manger
- The use of including upgrade.php when building custom queries
- Get the timout value of a saved transient?
- Does meta_query work within get_posts array?
- Slow meta_query with about 4 milion record on wp_postmeta
- How to show more than 5 posts?
- WordPress Find Duplicate Post By Content
- WP Query Sort by meta value (date)
- Remove posts from query for events whose start date has passed
- Insert static element only once in query archive
- How to run a mysql query when admin updates user role?
- pre_get_posts : ‘post__not_in’ doesn’t work with global variable
- Getting post data from private page
- WP Query with custom Shortcode
- Missing posts in a query
- Alter a specific query on WordPress
- Optional Meta Query
- Meta query for custom post type ignored in main query
- SQL query to select posts from multiple categories
- Protect sequence of pages with same password for each of two groups of users
- How is it possible to get top comment from all children?
- Select Query demand excesive resources [closed]
- Query to get number of posts last week
- I want to create a filter for the query string is this possible?
- Exclude categories from the_category();
- How can i show all categories using wp query?
- All in One Calendar Plugin Custom Post Type Query [closed]
- Get Posts from Last 24 hours and Sort them via GD Star Rating
- Restrict query to last day with posts
- Custom query object with Simple-Fields custom date field
- How to set up hierarchical relationships without using plugins / meta query
- How to read the value of a WordPress $query associative array (hash) key
- Query posts based on previous query
- Waypoints + infinite scroll with custom query
- Querying with WP query using meta key price
- How do I get all results from my query
- Taxonomy filter under Polylang
- How to create an overview of posts with the same tag?
- create a link to a random post within the current category
- meta_query where the meta value is not the post title
- JetEngine Query Builder – order by value from repeater
- Change pure SQL database query to WordPress post query?
- Filter orders by modify date
- How to add url parameter to every search query in SearchWp?
- Woocommerce Get Orders By Meta Value
- Heavy meta query causing SQL crash
- Sort by postmeta on when searching
- Pulling an ACF into a query
- Meta query doesn’t remove placeholder escape before query
- Speed up search query that searches in post meta?
- How can I modify standard search query to include also ACF custom fields values?
- WordPress search form and search result through ACF field in custom taxonomy
- Using cron for multiple queries
- very slow wordpress query with default query
- Custom Query problem access the values
- Set posts per page for parent category and it’s all children
- Exclude sticky posts from query
- If more than 1 image show post link?
- Rewrite Query_Var URL Parameter with Slug
- How to query different categories on index?
- How to specify what kind of is_single post?
- Can’t See Media Queries with Inspect Tool [closed]
- Print data from wordpress sql query
- Can I create my own query in wordpress with traditional methods?
- ‘Active lotteries’ only custom query for woocommerce lottery plugin and elementor
- How to show sticky posts on all pages of the pagination, not just the first page?