How do I check if the user is on a taxonomy term parent, child or grandchild page?

Try get_ancestors(): $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); $ancestors = get_ancestors( $term->term_id, ‘product_range’, ‘taxonomy’ ); $hierarchy_levels = count( $ancestors ); switch ( $hierarchy_levels ) { case 0: // THIS IS THE PARENT CATEGORY // DO YOUR STUFF break; case 1: // THIS IS THE PARENT CATEGORY // DO YOUR STUFF … Read more

Custom post type archive page blank

You have to tell WP that archive.php should apply to your custom post type as well as it’s other defaults. You can use pre_get_posts filter to do this, be sure to research this well before using it as there is a right and wrong way to use this filter. For example, try: function add_custom_post_type_to_archiving( $query … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)