HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux vmi1674223.contaboserver.net 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC 2024 x86_64
User: root (0)
PHP: 7.4.3-4ubuntu2.22
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/ruby/wp-content/themes/echooling/index.php
<?php
get_header(); ?>

<div id="reactheme-blog" class="reactheme-blog blog-page">
   <?php
    //checking blog layout form option  
    $col         ='';
    $blog_layout =''; 
    $column      =''; 
    $blog_grid   ='';

    if(!empty($echooling_option['blog-layout']) || !is_active_sidebar( 'sidebar-1' )){

        $blog_layout = !empty($echooling_option['blog-layout']) ? $echooling_option['blog-layout'] : '';
        $blog_grid   =  !empty($echooling_option['blog-grid']) ? $echooling_option['blog-grid'] : '';
        $blog_grid   = !empty($blog_grid) ? $blog_grid : '12';
        if($blog_layout == 'full' || !is_active_sidebar( 'sidebar-1' ))
        {
            $layout ='full-layout';
            $col    = '-full';
            $column = 'sidebar-none';  
        } 
          
        elseif($blog_layout == '2left'){
            $layout = 'full-layout-left';  
        }
        elseif($blog_layout == '2right'){
            $layout = 'full-layout-right'; 
        } 
        else{
            $col = '';
            $blog_layout = ''; 
        }
    }
    else{
        $col         ='';
        $blog_layout =''; 
        $layout      ='';
        $blog_grid   ='12';
    }
?>
    
    <div class="row padding-<?php echo esc_attr( $layout) ?>">       
        <div class="contents-sticky col-md-12 col-lg-8<?php echo esc_attr($col); ?> <?php echo esc_attr($layout); ?>">                   
            <div class="row">            
                <?php
                    if ( have_posts() ) :           
                        /* Start the Loop */
                        while ( have_posts() ) : the_post();

                        $post_id   = get_the_id();
                        $author_id = $post->post_author;
                        $no_thumb  = "";

                        if ( !has_post_thumbnail() ) {
                          $no_thumb = "no-thumbs";
                        }?>

                    <div class="col-sm-<?php echo esc_attr($blog_grid);?> col-xs-12">
                        <article <?php post_class();?>>
                            <div class="blog-item <?php echo esc_attr($no_thumb); ?>">

                                <?php if ( has_post_thumbnail() ) {?>
                                    <div class="blog-img">
                                       <a href="<?php the_permalink();?>">
                                        <?php
                                          the_post_thumbnail();
                                        ?>
                                      </a>
                                    
                                    </div><!-- .blog-img -->
                                <?php }       
                                ?>
                                <div class="full-blog-content">
                                    <div class="title-wrap">  
                                          <div class="blog-meta">
                                              <ul class="btm-cate">                                                                        

                                               <?php if(!empty($echooling_option['blog-author-post'])){
                                               if ($echooling_option['blog-author-post'] == 'show'): ?>
                                                <li>    
                                                    
                                                    <div class="author">
                                                        <?php echo get_avatar( get_the_author_meta( 'ID' ), 32 ); ?>
                                                       <?php
                                                      $last_name = get_user_meta( $author_id, 'last_name', true );
                                                      $first_name = get_user_meta( $author_id, 'first_name', true );
                                                      if( !empty($first_name) && !empty($last_name)){
                                                        echo esc_html($first_name).' '. esc_html($last_name);
                                                      }else{
                                                         echo get_the_author();
                                                      }
                                                       ?>
                                                    </div>
                                                </li>
                                                <?php endif; }
                                                else{ ?>
                                                  <li>
                                                    <div class="author">
                                                    <?php echo get_avatar( get_the_author_meta( 'ID' ), 32 ); ?>
                                                      <?php 
                                                        $last_name = get_user_meta( $author_id, 'last_name', true );
                                                        $first_name = get_user_meta( $author_id, 'first_name', true );
                                                        if( !empty($first_name) && !empty($last_name)){
                                                            echo esc_html($first_name).' '. esc_html($last_name);
                                                        }else{
                                                            echo get_the_author();
                                                        } ?>
                                                    </div>
                                                </li>
                                               <?php }; ?>

                                                   <?php
                                                   if (!empty($echooling_option['blog-date'])):
                                                       if ($echooling_option['blog-date'] == 1): ?>
                                                         <li>
                                                           <div class="blog-date">
                                                            <i class="fa fa-calendar-check-o"></i><?php $post_date = get_the_date(); echo esc_attr($post_date);?>
                                                           </div>                                              
                                                         </li>                                                   
                                                       <?php endif;
                                                   else:
                                                   if (empty($echooling_option['blog-date'])):
                                                       ?>
                                                           <li>
                                                               <div class="blog-date">
                                                                <i class="fa fa-calendar-check-o"></i><?php $post_date = get_the_date(); echo esc_attr($post_date);?>
                                                               </div>                                              
                                                           </li>
                                                   <?php endif; 
                                               endif; ?>  

                                              <?php 
                                                  if(!empty($echooling_option['blog-category'])){
                                                      if($echooling_option['blog-category'] == 'show'){
                                                          if(get_the_category()): ?>
                                                          <li>                                                      
                                                            <?php                                                                
                                                              echo '<div class="tag-line">';
                                                              ?>
                                                              <i class="fas fa-book"></i>
                                                              <?php
                                                              the_category(', '); 
                                                              echo '</div>';
                                                            ?> 
                                                          </li>
                                                <?php endif;
                                                      }
                                                }else{
                                                   if(get_the_category()): ?>
                                                  <li>                                                      
                                                      <?php
                                                          //tag add
                                                          $seperator = ', '; // blank instead of comma
                                                          $after = '';
                                                          $before = '';
                                                          echo '<div class="tag-line">';
                                                          ?>
                                                          <i class="fas fa-book"></i>
                                                          <?php
                                                          the_category(', '); 
                                                          echo '</div>';
                                                        ?> 
                                                      </li>
                                                  <?php
                                              endif;
                                                } ?>
                                            </ul>                                                         
                                        </div>                                                                    
                                        <h3 class="blog-title">
                                            <a href="<?php the_permalink();?>">
                                                <?php the_title();?>
                                            </a>
                                        </h3>                                        
                                  </div>

                                    <div class="blog-desc">   
                                        <?php echo echooling_custom_excerpt(30);?>                                     
                                    </div>

                                    <?php 
                                        $no_view = "";
                                        if(!empty($echooling_option['view-comments'])){
                                          if ($echooling_option['view-comments'] == 'hide'){
                                              $no_view = "left-btn";
                                          }
                                        }
                                          
                                        if(!empty($echooling_option['blog_readmore'])):?>
                                            <div class="blog-button <?php echo esc_attr($no_view); ?>">
                                                <a href="<?php the_permalink();?>">
                                                    <?php echo esc_html($echooling_option['blog_readmore']); ?>
                                                </a>
                                            </div>
                                    <?php endif; ?>

                                  <?php if(empty($echooling_option['blog_readmore'])):?>
                                      <div class="blog-button <?php echo esc_attr($no_view); ?>">
                                        <a href="<?php the_permalink();?>"><?php esc_html_e('Read More', 'echooling');?> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg></a>
                                      </div>
                                  <?php endif; ?>

                            </div>
                          </div>
                        </article>
                    </div>
                
                <?php  
                  endwhile;                        
                ?>
            </div>
            <div class="pagination-area">
                <?php
                    the_posts_pagination();
                ?>
            </div>
            <?php
            else :
            get_template_part( 'template-parts/content', 'none' );
            endif; ?> 
        </div>
        <?php if( $layout != 'full-layout' ):     
            get_sidebar();    
        endif;
        ?>
    </div>      
</div>
<?php
get_footer();