Function get_queried_object() return NULL in custom taxonomy
Question
Hi i need get term ID from custom taxonomy but it is always NULL.
taxonomy-galerie-kategorie.php
<?php
/**
* A custom taxonomy template for gallery.
*/
?>
<?php Starkers_Utilities::get_template_parts( array( 'parts/shared/html-header', 'parts/shared/header' ) ); ?>
<?php Starkers_Utilities::get_template_parts( array( 'parts/templates/header-image' ) ); ?>
<?php Starkers_Utilities::get_template_parts( array( 'parts/templates/gallery' ) ); ?>
<?php Starkers_Utilities::get_template_parts( array( 'parts/shared/footer','parts/shared/html-footer' ) ); ?>
query_posts(['post_type' => 'galerie']);
$terms = get_categories([
'taxonomy' => 'galerie-kategorie',
'hide_empty' => false,
'orderby' => 'date',
'order' => 'ASC'
]);
var_dump(get_queried_object());
Can someone help me please?
0
custom-taxonomy, taxonomy, terms, wp-query
3 years
2019-12-04T09:05:01-05:00
2019-12-04T09:05:01-05:00 0 Answers
131 views
0
Leave an answer