Dashboard
PHP:
8.3.17
OS:
Linux
User:
www-data
/
/
var
/
www
/
html
/
wp-content
/
themes
/
seozie
📤 Upload
📝 New File
📁 New Folder
Close
Editing: archive.php
<?php /** * The main template file * * This is the most generic template file in a WordPress theme * and one of the two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query. * E.g., it puts together the home page when no home.php file exists. * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package WordPress * @subpackage seozie * @since seozie 1.0 */ get_header(); $pt_theme_opt = get_option('pt_theme_opt'); ?> <div class="peacefulthemes-contain-area"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <div class="container"> <?php $flag = 1; $row = 'row'; $blogcol = 'col-xl-12 col-lg-12 col-md-12'; $sidecol = 'col-xl-4 col-lg-4 col-md-12'; $mainblogcol = 'col-lg-8'; if(is_active_sidebar('sidebar-1')) { $mainblogcol = 'col-lg-8 col-xl-8 col-md-12'; $sidebar = true; } else { $mainblogcol = 'col-lg-12 col-xl-12 col-md-12'; $sidebar = false; } if(isset($pt_theme_opt['archive_blog_layout']) && $pt_theme_opt['archive_blog_layout'] === 'one-column'){ $row = 'row'; $blogcol = 'col-lg-12'; } else if(isset($pt_theme_opt['archive_blog_layout']) && $pt_theme_opt['archive_blog_layout'] === 'two-column'){ $row = 'row'; $blogcol = 'col-lg-6'; } else if(isset($pt_theme_opt['archive_blog_layout']) && $pt_theme_opt['archive_blog_layout'] === 'three-column'){ $row = 'row'; $blogcol = 'col-lg-4'; } else if(isset($pt_theme_opt['archive_blog_layout']) && $pt_theme_opt['archive_blog_layout'] === 'four-column'){ $row = 'row'; $blogcol = 'col-lg-3'; } else if(isset($pt_theme_opt['archive_blog_layout']) && $pt_theme_opt['archive_blog_sidebar'] === 'no_sidebar'){ $sidebar = false; $mainblogcol = 'col-lg-12'; } if(isset($pt_theme_opt['archive_blog_layout']) && $pt_theme_opt['archive_blog_sidebar'] === 'right_sidebar'){ if(is_active_sidebar('sidebar-1')) { $sidebar = true; $mainblogcol = 'col-lg-8 col-xl-8 col-md-12'; } else { $sidebar = false; } $row = 'row'; } else if(isset($pt_theme_opt['archive_blog_layout']) && $pt_theme_opt['archive_blog_sidebar'] === 'left_sidebar'){ if(is_active_sidebar('sidebar-1')) { $sidebar = true; $mainblogcol = 'col-lg-8 col-xl-8 col-md-12'; } else { $sidebar = false; } $row = 'row flex-row-reverse'; } ?> <div class="<?php echo esc_attr($row , 'seozie'); ?>"> <?php if ( have_posts() ){ if($flag == 1){ echo '<div class="'.esc_attr($mainblogcol).'"> <div class="row">'; // Start the loop. while ( have_posts() ){ the_post(); /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ echo '<div class="'.esc_attr($blogcol,'seozie').'">'; get_template_part( 'template-parts/post/content', get_post_format() ); echo '</div>'; //End $blogcol class div // End the loop. } seozie_pagination(); echo '</div></div>'; //End $blogcol class div // Previous/next page navigation. if($sidebar){ ?> <div class="<?php echo esc_attr($sidecol , 'seozie'); ?>"> <?php get_sidebar(); ?> </div> <?php } } if($flag == 0){ // Start the loop. while ( have_posts() ) { the_post(); /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ echo '<div class="'.esc_attr($blogcol,'seozie').'">'; get_template_part( 'template-parts/post/content', get_post_format() ); echo '</div>'; // End the loop. } // Previous/next page navigation. } } else { get_template_part( 'template-parts/post/content', get_post_format() ); } ?> </div> <!-- .Row --> </div> </main><!-- .site-main --> </div><!-- .content-area --> </div> <?php get_footer();
Save
Cancel