get_page_template
returns the template of the current active post/page. You’re not on a post/page though, you’re in a listing/archive.
When you get page.php
what you’re seeing is the template of the first post/page. The taxonomy listing itself is not a page, it’s a listing, and so it makes no sense for it to have a page template, as it is not a page.
See here for an answer that should do what you want:
Get name of the current template file
this may also work:
/* show me what the body class will look like */
echo body_class() . "\n";
/* make sure i've got $template */
global $template;
/* print the active template path and filename */
print_r($template);
( Although why check if you’re in template X inside template X, surely the answer will always be yes? )
Related Posts:
- How can I set up a category “overview” page?
- Override Taxonomy Template
- How to get a terms and posts associated with another term?
- How to display custom taxonomy
- Custom Taxonomy Template Variables Available?
- is_tax not working for custom taxonomy
- Using wp_query is it possible to orderby taxonomy?
- How to add images to taxonomies?
- custom post type taxonomy “tag” archive : no post found
- Can’t get a custom template taxonomy page to display
- Custom Taxonomy Archive Page
- Get taxonomy names by post id
- Return only the custom sub-term for custom post type, do not echo term-parent
- Get total number of comments from posts in a specific custom taxonomy
- Custom hierarchal taxonomy loses interface hierarchy when selecting parent & children
- Formating the_terms() function output
- Archive template for taxonomy terms
- Custom taxonomy on users with UI
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- On Taxonomy Template page, want to add Post_Type
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- Taxonomy Relationships
- Combine multiple custom user taxonomy in single url
- Add custom taxonomy to default category taxonomy?
- Display sub-taxonomies based on SELECTED parent-taxonomy
- Checking if a Page has an Associated Term?
- What are terms and taxonomy, how they related to post and how these three are stored in database?
- Taxonomy , subtaxonomy,child taxonomy of a product woocommerce
- Get terms ordered by post date
- How to display custom taxonomy in multiple columns?
- How can I get WP to build a feed based on multiple taxonomy terms
- Change permalink of post if it belongs to custom taxonomy
- Get pages only with a specific taxonomy
- Share taxonomy between user and posts?
- ACF vs Taxonomies
- How to filter terms from a custom taxonomy by a usermeta value on all screens and templates
- How to obtain the link/URL to the feed of a custom taxonomy?
- get_term_children doesn’t return an array of children terms
- Use get_the_terms to list subcategories of custom taxonomy
- Get taxonomy parent using child slug (from merged taxonomies)
- Custom taxonomy [year] is directing to yearly archive
- Display Taxonomy Terms in an option tag with value being the slug
- Modify “View” in admin panel for custom taxonomy
- Taxonomies on custom taxonomies
- Hide product categories and taxonomy terms in menu if empty
- Custom taxonomy forms for user profile
- How to add Post Format Taxonomy Archive page in the menu?
- Query posts by taxonomy with current term
- WordPress Doesn’t Generate Taxonomy Archive
- get the taxonomies terms associated with users
- Add Taxonomy Subcategory To Permalink
- problem in taxonomy-{taxonomy}.php pagination
- Create custom taxonomy and Display in metabox dropdown
- Custom Taxonomy with tax_query
- Get posts in certain Taxonomy terms for the current page url
- How to add images to taxonomy terms? [duplicate]
- Trying to add taxonomy to get_categories() but it’s not working. How to fix this?
- Edit custom taxonomy description programatically
- Get taxonomy name for the current post
- View the complete list of a taxonomy in the navigation menu
- Get name of taxonomies of current page
- Filter through custom taxonomy with an array of taxonomy IDs
- pagination not working on custom-taxonomy template
- Dropdown taxonomy lists in admin menu
- Add custom taxonomy as a css class
- Taxonomy page shows category in title
- Query custom taxonomy for category including children
- Taxonomy Overview Page?
- Order taxonomy terms wordpress
- Only display latest custom taxonomy post
- Unable to get the Parent Custom Taxonomy Terms
- How to define %category% for custom taxonomies?
- Unsetting post_tag taxonomy breaks term description for other taxonomies
- Taxonomies on Pages with Custom Formatting
- Catch all taxonomy template
- How to combine taxonomies into URL?
- Why do my quick edits for custom taxonomies not show on the post frontend?
- Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
- Tracking the name of a custom taxonomy
- Add terms to a taxonomy archive from within the same taxonomy
- Show recent posts from a custom taxonomy in wordpress
- Fill New Taxonomies
- How do I get the correct URL?
- how do you pull data from two taxonomies?
- problem : Custom taxonomy template not showing
- Filter “get_terms” query
- How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?
- generate random slug when adding taxonomy
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Sort Taxonomy List by Custom Values
- Display taxonomy term slugs
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Taxonomy term breadcrumb; how?
- How to display custom taxonomy and terms using/creating plugin template
- Advanced AND tax_query in sidebar with 2 taxonomies
- Using wp_query is it possible to orderby taxonomy?
- Alternative for is_taxonomy() to workaround theme’s default sidebar
- Get custom taxonomy term url on archive page
- Group custom taxonomies based on tags contained in their posts
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post