Advertisement
studioart

archivemodified

May 18th, 2023
1,019
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.49 KB | None | 0 0
  1. <?php
  2.     if( ! defined( 'ABSPATH' ) ) { die(); }
  3.  
  4.     global $avia_config, $more;
  5.  
  6.     /*
  7.      * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
  8.      */
  9.     get_header();
  10.  
  11.     $showheader = true;
  12.  
  13.             //  get the current taxonomy term
  14.                 $term = get_queried_object();
  15.             //  vars - ACF for showing Images and Color in Category Backend
  16.                 $image = get_field('image', $term);
  17.                 $color = get_field('color', $term);                  
  18.     if( avia_get_option( 'frontpage' ) && $blogpage_id = avia_get_option( 'blogpage' ) )
  19.     {
  20.         if( get_post_meta( $blogpage_id, 'header', true ) == 'no' )
  21.         {
  22.             $showheader = false;
  23.         }
  24.     }
  25.  
  26.     if( $showheader )
  27.     {
  28.         echo avia_title( array( 'title' => avia_which_archive() ) );
  29.     }
  30.  
  31.     do_action( 'ava_after_main_title' );
  32.  
  33.     ?>
  34.  
  35.         <div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'>
  36.  
  37.  
  38.  
  39. <div id="av_section_2" class="category-description-background avia-section main_color avia-section-default avia-shadow avia-bg-style-scroll avia-builder-el-1 el_after_av_section avia-builder-el-last container_wrap sidebar_right" >
  40.  
  41.     <style type="text/css">
  42.  
  43.         .entry-content-wrapper .post-title {
  44.             color: <?php echo $color; ?>;
  45.         }
  46.         .blog-categories.minor-meta a {
  47.             color: <?php echo $color; ?>;
  48.             }
  49.         <?php if( $image ): ?>
  50.             .categoryheaderimage {
  51.                 background-image: url(<?php echo $image['url']; ?>);
  52.             }
  53.         <?php endif; ?>
  54.     </style>         
  55.  
  56.     <div class="categoryheaderimage">
  57.            
  58.     </div>
  59.    
  60.    
  61.     <div class="container">
  62.         <div class="template-page content  av-content-small alpha units">
  63.             <div class="post-entry post-entry-type-page">
  64.                 <div class="entry-content-wrapper clearfix">
  65.                     <?php
  66.  
  67.                     $tds = term_description();
  68.                     if( $tds )
  69.                     {
  70.                         echo "<div class='category-term-description'>{$tds}</div>";
  71.                     }
  72.                     ?>
  73.                 </div>
  74.             </div>
  75.         </div>
  76.     </div>
  77. </div> 
  78.  
  79.             <div class='container template-blog '>
  80.  
  81.                 <main class='content <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper( array( 'context' => 'content', 'post_type' => 'post' ) );?>>
  82.                     <?php  if( is_category() )
  83.                         {
  84.                         //  echo '<h1>' . 'Kategorie: ' . single_cat_title('',false) . '</h1>';
  85.                         }          
  86.                     ?>
  87.                    
  88.                     <?php  if( is_tag() )
  89.                         {
  90.                         //  echo '<h1>' . 'Schlagwort: ' . single_tag_title('',false) . '</h1>';
  91.                         }
  92.                     ?>
  93.                
  94.                     <?php
  95.                     $avia_config['blog_style'] = apply_filters( 'avf_blog_style', avia_get_option( 'blog_style', 'multi-big' ), 'archive' );
  96.                     if( $avia_config['blog_style'] == 'blog-grid' )
  97.                     {
  98.                         global $posts;
  99.  
  100.                         $post_ids = array();
  101.                         foreach( $posts as $post )
  102.                         {
  103.                             $post_ids[] = $post->ID;
  104.                         }
  105.  
  106.                         if( ! empty( $post_ids ) )
  107.                         {
  108.                             $atts = array(
  109.                                         'type'          => 'grid',
  110.                                         'items'         => get_option( 'posts_per_page' ),
  111.                                         'columns'       => 3,
  112.                                         'class'         => 'avia-builder-el-no-sibling',
  113.                                         'paginate'      => 'yes',
  114.                                         'use_main_query_pagination' => 'yes',
  115.                                         'contents'  => 'excerpt_read_more',  /* weiterlesen-link */
  116.                                         'custom_query'  => array(
  117.                                                                 'post__in'  => $post_ids,
  118.                                                                 'post_type' => get_post_types()
  119.                                                             )
  120.                                     );
  121.  
  122.                             /**
  123.                              * @since 4.5.5
  124.                              * @return array
  125.                              */
  126.                             $atts = apply_filters( 'avf_post_slider_args', $atts, 'archive' );
  127.  
  128.                             $blog = new avia_post_slider( $atts );
  129.                             $blog->query_entries();
  130.  
  131.                             echo '<div class="entry-content-wrapper">' . $blog->html() . '</div>';
  132.                         }
  133.                         else
  134.                         {
  135.                             get_template_part( 'includes/loop', 'index' );
  136.                         }
  137.                     }
  138.                     else
  139.                     {
  140.                         /* Run the loop to output the posts.
  141.                          * If you want to overload this in a child theme then include a file
  142.                          * called loop-index.php and that will be used instead.
  143.                          */
  144.                         $more = 0;
  145.                         get_template_part( 'includes/loop', 'index' );
  146.                     }
  147.                     ?>
  148.  
  149.                 <!--end content-->
  150.                 </main>
  151.  
  152.                 <?php
  153.  
  154.                 //get the sidebar
  155.                 if( avia_get_option( 'archive_sidebar' ) == 'archive_sidebar_separate' )
  156.                 {
  157.                     $avia_config['currently_viewing'] = 'archive';
  158.                 }
  159.                 else
  160.                 {
  161.                     $avia_config['currently_viewing'] = 'blog';
  162.                 }
  163.  
  164.                 get_sidebar();
  165.  
  166.                 ?>
  167.  
  168.             </div><!--end container-->
  169.  
  170.         </div><!-- close default .container_wrap element -->
  171.  
  172. <?php
  173.         get_footer();
  174.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement