Insert code on specific taxonomy archives

The is_tax() function checks if a custom taxonomy archive page is being displayed. So it will only work in template files such as taxonomy-product_cat.php – unless you create new templates for specific categories in the product_cat taxonomy. For example, if you have a product category called “Toasters” and the slug is “toasters” then the template … Read more

Filer taxonomy posts by current category

Use a taxonomy.php template?! taxonomy.php <?php get_header(); ?> <?php $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); ?> <h1><?php echo $term->name; ?></h1> <?php global $query_string; query_posts( $query_string . ‘&orderby=title&order=asc’ ); if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <h1><a href=”https://wordpress.stackexchange.com/questions/72934/<?php echo get_permalink(); ?>” title=”<?php the_title(); ?>” rel=”bookmark”><?php the_title(); ?></a></h1> <?php … Read more

List of taxonomy archive index page links

You can build a list using two functions: get_terms() and get_term_link(): <?php function wpse73271_get_term_archive_link_list( $taxonomy ) { // First, get an array of term IDs $term_objects = get_terms( $taxonomy ); // Now, loop through $term_ids and get // an array of term archive permalinks foreach ( $term_objects as $term_object ) { $term_object->url = get_term_link( $term_object, … Read more

Are taxonomy hierarchies possible?

I have run into similar problem with the system I am currently building – I needed ZIP codes to be children of Cities, which were to be children of States. What I have learned is that it was possible to add custom fields to the term creation form to link the term (e.g. ZIP) to … Read more

Get post terms with hierarchical relationships

I doubt you’re going to find a function that created the exact output you’re using, so you’re probably looking at two nested called to get_terms(). I usually avoid most other taxonomy-related plugins in favor of get terms. Most of the other functions are wrappers for this one. Here’s some psuedo-code for what I’d do: <?php … Read more

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