is_tax example


            }

            $posts_page = esc_url( $posts_page );
            if ( 'list' === $parsed_args['style'] ) {
                $output .= "<li class='cat-item-all'><a href='$posts_page'>$show_option_all</a></li>";
            } else {
                $output .= "<a href='$posts_page'>$show_option_all</a>";
            }
        }

        if ( empty( $parsed_args['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) {
            $current_term_object = get_queried_object();
            if ( $current_term_object && $parsed_args['taxonomy'] === $current_term_object->taxonomy ) {
                $parsed_args['current_category'] = get_queried_object_id();
            }
        }

        if ( $parsed_args['hierarchical'] ) {
            $depth = $parsed_args['depth'];
        } else {
            $depth = -1; // Flat.         }
        
$tag       = $wp_query->get_queried_object();
            $classes[] = 'tag';
            if ( isset( $tag->term_id ) ) {
                $tag_class = sanitize_html_class( $tag->slug, $tag->term_id );
                if ( is_numeric( $tag_class ) || ! trim( $tag_class, '-' ) ) {
                    $tag_class = $tag->term_id;
                }

                $classes[] = 'tag-' . $tag_class;
                $classes[] = 'tag-' . $tag->term_id;
            }
        } elseif ( is_tax() ) {
            $term = $wp_query->get_queried_object();
            if ( isset( $term->term_id ) ) {
                $term_class = sanitize_html_class( $term->slug, $term->term_id );
                if ( is_numeric( $term_class ) || ! trim( $term_class, '-' ) ) {
                    $term_class = $term->term_id;
                }

                $classes[] = 'tax-' . sanitize_html_class( $term->taxonomy );
                $classes[] = 'term-' . $term_class;
                $classes[] = 'term-' . $term->term_id;
            }
        }
/** * Gets the REST route for the currently queried object. * * @since 5.5.0 * * @return string The REST route of the resource, or an empty string if no resource identified. */
function rest_get_queried_resource_route() {
    if ( is_singular() ) {
        $route = rest_get_route_for_post( get_queried_object() );
    } elseif ( is_category() || is_tag() || is_tax() ) {
        $route = rest_get_route_for_term( get_queried_object() );
    } elseif ( is_author() ) {
        $route = '/wp/v2/users/' . get_queried_object_id();
    } else {
        $route = '';
    }

    /** * Filters the REST route for the currently queried object. * * @since 5.5.0 * * @param string $link The route with a leading slash, or an empty string. */

function is_tax( $taxonomy = '', $term = '' ) {
    global $wp_query;

    if ( ! isset( $wp_query ) ) {
        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
        return false;
    }

    return $wp_query->is_tax( $taxonomy$term );
}

/** * Determines whether the query is for an existing date archive. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 1.5.0 * * @global WP_Query $wp_query WordPress Query object. * * @return bool Whether the query is for an existing date archive. */
$title['title'] = sprintf( __( 'Search Results for &#8220;%s&#8221;' )get_search_query() );

        // If on the front page, use the site title.     } elseif ( is_front_page() ) {
        $title['title'] = get_bloginfo( 'name', 'display' );

        // If on a post type archive, use the post type archive title.     } elseif ( is_post_type_archive() ) {
        $title['title'] = post_type_archive_title( '', false );

        // If on a taxonomy archive, use the term title.     } elseif ( is_tax() ) {
        $title['title'] = single_term_title( '', false );

        /* * If we're on the blog page that is not the homepage * or a single post of any post type, use the post title. */
    } elseif ( is_home() || is_singular() ) {
        $title['title'] = single_post_title( '', false );

        // If on a category or tag archive, use the term title.     } elseif ( is_category() || is_tag() ) {
        
if ( $content_found ) {
                $set_404 = false;
            }

            // We will 404 for paged queries, as no posts were found.         } elseif ( ! is_paged() ) {
            $author = get_query_var( 'author' );

            // Don't 404 for authors without posts as long as they matched an author on this site.             if ( is_author() && is_numeric( $author ) && $author > 0 && is_user_member_of_blog( $author )
                // Don't 404 for these queries if they matched an object.                 || ( is_tag() || is_category() || is_tax() || is_post_type_archive() ) && get_queried_object()
                // Don't 404 for these queries either.                 || is_home() || is_search() || is_feed()
            ) {
                $set_404 = false;
            }
        }

        if ( $set_404 ) {
            // Guess it's time to 404.             $wp_query->set_404();
            status_header( 404 );
            
/** * Renders the `core/term-description` block on the server. * * @param array $attributes Block attributes. * * @return string Returns the description of the current taxonomy term, if available */
function render_block_core_term_description( $attributes ) {
    $term_description = '';

    if ( is_category() || is_tag() || is_tax() ) {
        $term_description = term_description();
    }

    if ( empty( $term_description ) ) {
        return '';
    }

    $classes = array();
    if ( isset( $attributes['textAlign'] ) ) {
        $classes[] = 'has-text-align-' . $attributes['textAlign'];
    }
    
if ( false !== $author
                && $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE $wpdb->posts.post_author = %d AND $wpdb->posts.post_status = 'publish' LIMIT 1", $author->ID ) )
            ) {
                $redirect_url = get_author_posts_url( $author->ID, $author->user_nicename );
                $redirect_obj = $author;

                if ( $redirect_url ) {
                    $redirect['query'] = remove_query_arg( 'author', $redirect['query'] );
                }
            }
        } elseif ( is_category() || is_tag() || is_tax() ) { // Terms (tags/categories).             $term_count = 0;

            foreach ( $wp_query->tax_query->queried_terms as $tax_query ) {
                if ( isset( $tax_query['terms'] ) && is_countable( $tax_query['terms'] ) ) {
                    $term_count += count( $tax_query['terms'] );
                }
            }

            $obj = $wp_query->get_queried_object();

            if ( $term_count <= 1 && ! empty( $obj->term_id ) ) {
                
Home | Imprint | This part of the site doesn't use cookies.