Advertisement
palsushobhan

enfold-theme-store-article-template.php

Jan 20th, 2022
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.15 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The Template for displaying all store articles.
  4.  *
  5.  * @package WCfM Markeplace Views Store/articles
  6.  *
  7.  * For edit coping this to yourtheme/wcfm/store
  8.  *
  9.  */
  10.  
  11. if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  12.  
  13. global $WCFM, $WCFMmp, $avia_config, $more;
  14. ?>
  15.  
  16. <?php do_action( 'wcfmmp_store_before_articles', $store_user->get_id() ); ?>
  17.  
  18. <div class='container_wrap container_wrap_first main_color <?php avia_layout_class('main'); ?>'>
  19.     <div class='container template-blog '>
  20.         <main class='content <?php avia_layout_class('content'); ?> units' <?php avia_markup_helper(array('context' => 'content', 'post_type' => 'post')); ?>>
  21.         <?php
  22.         $tds =  term_description();
  23.         if ($tds) {
  24.             echo "<div class='category-term-description'>{$tds}</div>";
  25.         }
  26.         $avia_config['blog_style'] = apply_filters('avf_blog_style', avia_get_option('blog_style', 'multi-big'), 'archive');
  27.         if ($avia_config['blog_style'] == 'blog-grid') {
  28.             global $posts;
  29.  
  30.             $post_ids = array();
  31.             foreach ($posts as $post) {
  32.                 $post_ids[] = $post->ID;
  33.             }
  34.  
  35.             if (!empty($post_ids)) {
  36.                 $atts = array(
  37.                     'type'          => 'grid',
  38.                     'items'         => get_option('posts_per_page'),
  39.                     'columns'       => 3,
  40.                     'class'         => 'avia-builder-el-no-sibling',
  41.                     'paginate'      => 'yes',
  42.                     'use_main_query_pagination' => 'yes',
  43.                     'custom_query'  => array(
  44.                         'post__in'  => $post_ids,
  45.                         'post_type' => get_post_types()
  46.                     )
  47.                 );
  48.  
  49.                 /**
  50.                  * @since 4.5.5
  51.                  * @return array
  52.                  */
  53.                 $atts = apply_filters('avf_post_slider_args', $atts, 'archive');
  54.  
  55.                 $blog = new avia_post_slider($atts);
  56.                 $blog->query_entries();
  57.  
  58.                 echo "<div class='entry-content-wrapper'>" . $blog->html() . "</div>";
  59.             } else {
  60.                 get_template_part('includes/loop', 'index');
  61.             }
  62.         } else {
  63.             /* Run the loop to output the posts.
  64.             * If you want to overload this in a child theme then include a file
  65.             * called loop-index.php and that will be used instead.
  66.             */
  67.  
  68.             $more = 0;
  69.             get_template_part('includes/loop', 'index');
  70.         }
  71.         ?>
  72.         </main>
  73.     </div>
  74. </div>
  75.  
  76. <?php do_action( 'wcfmmp_store_after_articles', $store_user->get_id() ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement