These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * The main template file. |
||
4 | * |
||
5 | * This is the most generic template file in a WordPress theme |
||
6 | * and one of the two required files for a theme (the other being style.css). |
||
7 | * It is used to display a page when nothing more specific matches a query. |
||
8 | * E.g., it puts together the home page when no home.php file exists. |
||
9 | * Learn more: http://codex.wordpress.org/Template_Hierarchy |
||
10 | * |
||
11 | * @package lsx |
||
12 | */ |
||
13 | |||
14 | get_header(); ?> |
||
15 | |||
16 | <?php lsx_content_wrap_before(); ?> |
||
17 | |||
18 | <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
||
19 | |||
20 | <?php lsx_content_before(); ?> |
||
21 | |||
22 | <main id="main" class="site-main"> |
||
23 | |||
24 | <?php lsx_content_top(); ?> |
||
25 | |||
26 | View Code Duplication | <?php if ( have_posts() ) : ?> |
|
0 ignored issues
–
show
|
|||
27 | |||
28 | <?php /* Start the Loop */ ?> |
||
29 | <?php while ( have_posts() ) : the_post(); ?> |
||
30 | |||
31 | <?php |
||
32 | /* Include the Post-Format-specific template for the content. |
||
33 | * If you want to override this in a child theme, then include a file |
||
34 | * called content-___.php (where ___ is the Post Format name) and that will be used instead. |
||
35 | */ |
||
36 | get_template_part( 'content', get_post_format() ); |
||
37 | ?> |
||
38 | |||
39 | <?php endwhile; ?> |
||
40 | |||
41 | <?php lsx_paging_nav(); ?> |
||
42 | |||
43 | <?php else : ?> |
||
44 | |||
45 | <?php get_template_part( 'content', 'none' ); ?> |
||
46 | |||
47 | <?php endif; ?> |
||
48 | |||
49 | <?php lsx_content_bottom(); ?> |
||
50 | |||
51 | </main><!-- #main --> |
||
52 | |||
53 | <?php lsx_content_after(); ?> |
||
54 | |||
55 | </div><!-- #primary --> |
||
56 | |||
57 | <?php lsx_content_wrap_after(); ?> |
||
58 | |||
59 | <?php get_sidebar( 'sidebar' ); ?> |
||
60 | <?php get_footer(); |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.