AmitT /
podium
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 podium |
||
| 12 | */ |
||
| 13 | use Podium\Config\Settings as settings; |
||
| 14 | |||
| 15 | $settings = new settings(); |
||
| 16 | |||
| 17 | get_header(); |
||
| 18 | ?> |
||
| 19 | <div class="grid-container"> |
||
| 20 | <div id="content" class="site-content grid-x grid-padding-x"> |
||
| 21 | <div id="primary" class="content-area small-12 <?php echo $settings->getContentClass('medium-8', ''); ?> cell"> |
||
| 22 | <main id="main" class="site-main" role="main"> |
||
| 23 | <?php if (have_posts()) { |
||
| 24 | /* Start the Loop */ |
||
| 25 | |||
| 26 | View Code Duplication | while (have_posts()) { |
|
|
0 ignored issues
–
show
|
|||
| 27 | the_post(); |
||
| 28 | |||
| 29 | /* |
||
| 30 | * Include the Post-Format-specific template for the content. |
||
| 31 | * If you want to override this in a child theme, then include a file |
||
| 32 | * called content-___.php (where ___ is the Post Format name) and that will be used instead. |
||
| 33 | */ |
||
| 34 | if (get_post_type() != 'post') { |
||
| 35 | get_template_part('template-parts/content', get_post_type()); |
||
| 36 | } else { |
||
| 37 | get_template_part('template-parts/content-post', get_post_format()); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | if (function_exists('podium_pagination')) { |
||
| 42 | podium_pagination(); |
||
| 43 | } |
||
| 44 | |||
| 45 | } else { |
||
| 46 | get_template_part('template-parts/content', 'none'); |
||
| 47 | } |
||
| 48 | |||
| 49 | ?> |
||
| 50 | |||
| 51 | </main><!-- #main --> |
||
| 52 | </div> |
||
| 53 | <?php |
||
| 54 | if ($settings->displaySidebar()) { |
||
| 55 | get_template_part('template-parts/sidebar', 'page'); |
||
| 56 | } |
||
| 57 | ?> |
||
| 58 | </div><!-- #content --> |
||
| 59 | </div><!-- .grid-container --> |
||
| 60 | |||
| 61 | <?php get_footer(); |
||
| 62 |
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.