Code Duplication    Length = 22-22 lines in 2 locations

app/classy/classy-template.php 2 locations

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