Code Duplication    Length = 22-22 lines in 2 locations

app/classy/classy-template.php 2 locations

@@ 202-223 (lines=22) @@
199
200
		// Front Page
201
202
		elseif ( $type == 'front-page' ):
203
204
			$id = get_queried_object_id();
205
206
			$pagename = get_query_var('pagename');
207
208
			if ( ! $pagename && $id ) {
209
				// If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
210
				$post = get_queried_object();
211
				if ( $post )
212
					$pagename = $post->post_name;
213
			}
214
215
			$template = get_post_meta('theme-page-template', $id);
216
217
			if ( $template != 'index' )
218
				$templates[] = $template;
219
			if ( $pagename )
220
				$templates[] = "page-$pagename";
221
			if ( $id )
222
				$templates[] = "page-$id";
223
			$templates[] = '';
224
225
		// Page
226
@@ 227-248 (lines=22) @@
224
225
		// Page
226
227
		elseif ( $type == 'page' ):
228
229
			$id = get_queried_object_id();
230
			
231
			$template = get_post_meta('theme-page-template', $id);
232
233
			$pagename = get_query_var('pagename');
234
235
			if ( ! $pagename && $id ) {
236
				// If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
237
				$post = get_queried_object();
238
				if ( $post )
239
					$pagename = $post->post_name;
240
			}
241
242
			if ( $template != 'index' )
243
				$templates[] = $template;
244
			if ( $pagename )
245
				$templates[] = "page-$pagename";
246
			if ( $id )
247
				$templates[] = "page-$id";
248
			$templates[] = 'page';
249
250
251
		// Default