Order archive results by post id in custom taxonomy template
I used this Sort results by name & asc order on Archive.php changed to select the archive template if(is_archive( ‘taxonomy-places.php’)):
I used this Sort results by name & asc order on Archive.php changed to select the archive template if(is_archive( ‘taxonomy-places.php’)):
the wp_get_post_categories function will return the categories for the first post in the loop not the post the user has just clicked on. You need to pass the categories from the previous post to use in your custom loop.
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 taxonomy archive shows 404 error
First, a clarification- you have one taxonomy, which contains parent and child terms. When you associate terms to a post, only the terms you select are explicitly associated to that post. Taxonomy terms are stored in their own table, and parent and child terms are connected to each other in this table. This is how … Read more
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
Create archive page for woocommerce attribute
Adding tag’s featured image to tag archive
The only way to build what I did was to use different WP_Queries. I ran in to a few issues because I wanted to use the same layout for viewing categories. I know this isn’t much of an answer so I did sign up on the github network and post a gist of it: full … Read more
Multiple category archive page