Single taxonomy for different custom post types

I think this is what you are searching for… You must use both post_type and tax_query to filter your query $query = new WP_Query( array( ‘post_type’ => ‘books’, // name of post type. ‘tax_query’ => array( array( ‘taxonomy’ => ‘fiction’, // taxonomy name ) ) ) ); while ( $query->have_posts() ) : $query->the_post(); // do … Read more

Custom TaxonomyTemplate

Create a page with slug ‘brand’. Then create a custom page template and write required loop to return the terms of the ‘brand’ taxonomy. Assign that page template to ‘Brand’ page. Visit this codex page to know how to code a page template. And here is an example of how to list terms of custom … Read more

WordPress Custom Post Type – Post Attribute: Template. Template shows up and saves on the back end, but the default theme file is being rendered

in your code: $labels = array( ‘name’ => _x( ‘Locations’, ‘info_locaiton’ ), ‘singular_name’ => _x( ‘Location’, ‘info_location’ ) ); use this: $labels = array( ‘name’ => _x( ‘Locations’, ‘info_location’ ), ‘singular_name’ => _x( ‘Location’, ‘info_location’ ) ); In $labels variable name array value has different slug. I think this can be a problem. So, you … Read more

URL Rewrite and Archive Template Files – Post Type vs. Taxonomy

I handled this with a pre_get_posts hook (thanks, @Milo), passing in the URL part that corresponds to the slug I need. Hope this helps someone down the road. Improvements are welcome. Thanks. function filter_team_news_archives_by_sport_taxonomy($query) { if (is_post_type_archive(‘team-news’) && $query->is_main_query()){ // Get $sport_slug from URL — https://stackoverflow.com/a/36002190/4107296 $url = (isset($_SERVER[‘HTTPS’]) ? “https” : “http”) . “://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]”; … Read more

taxonomy – templates are not loading

There is no direct template for subcategories/subterms. both will be accessible in taxonomy.php I didn’t get what’s your requirement to have a separate page for subcategories/subterms. but you can handle this on taxonomy.php if( subcat ){ // show sub category view }elseif(parent) { // show parent category view } or check this answer more related … Read more

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