| | 108 | if (get_post_type() == false) { |
| | 109 | $term = get_queried_object(); |
| | 110 | $type = $term->taxonomy; |
| | 111 | } |
| | 112 | else { |
| | 113 | $type = get_query_var('post_type'); |
| | 114 | } |
| | 115 | |
| | 116 | $default_types = array('post', 'page', 'attachment', 'category', 'post_tag', 'link_category', 'post_format'); |
| | 117 | if (!in_array($type, $default_types)) { |
| | 118 | if (isset($name)) { |
| | 119 | $templates[] = "$slug-$name-$type.php"; |
| | 120 | } |
| | 121 | $templates[] = "$slug-$type.php"; |
| | 122 | } |
| 110 | | return locate_template($templates, true, false); |
| | 125 | $template = locate_template($templates); |
| | 126 | |
| | 127 | if (!in_array($type, $default_types)) { |
| | 128 | $template = apply_filters('get_custom_template_part', $template, $type, $slug, $name); |
| | 129 | } |
| | 130 | |
| | 131 | return load_template($template, false); |