Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'wcfmmp_before_store_article', function() {
- do_action( 'wolmart_print_before_page_layout' );
- echo '<div class="post-archive">';
- } );
- add_action('wcfmmp_before_store_article_loop', function() {
- global $wolmart_layout, $wp_query;
- $posts_filter = $wolmart_layout['posts_filter'];
- $wrap_classes = array( 'posts' );
- $wrap_attrs = '';
- if ( isset( $_REQUEST['post_type'] ) && in_array( $_REQUEST['post_type'], array( 'list', 'mask', 'simple' ) ) ) {
- $wolmart_layout['post_type'] = $_REQUEST['post_type'];
- } elseif ( wolmart_doing_ajax() && ! empty( $_REQUEST['only_posts'] ) ) {
- $wolmart_layout['post_type'] = '';
- }
- if(empty($wolmart_layout['post_type'])) {
- $wolmart_layout['post_type'] = 'list';
- }
- $post_type = $wolmart_layout['post_type'];
- // Category Filter
- if ( $posts_filter &&
- ( empty( $wolmart_layout['left_sidebar'] ) || 'hide' == $wolmart_layout['left_sidebar'] ) &&
- ( empty( $wolmart_layout['right_sidebar'] ) || 'hide' == $wolmart_layout['right_sidebar'] ) &&
- 'list' != $post_type ) {
- wolmart_get_template_part( 'posts/elements/blog-filter' );
- }
- // Grid or Masonry
- if ( 'masonry' == $wolmart_layout['posts_layout'] ) {
- $wrap_classes[] = 'grid';
- $wrap_classes[] = 'masonry';
- $wrap_attrs = " data-grid-options='" . json_encode( array( 'masonry' => array( 'horizontalOrder' => true ) ) ) . "'";
- wp_enqueue_script( 'isotope-pkgd' );
- }
- // List or Grid
- if ( 'list' == $post_type ) {
- $wrap_classes[] = 'list-type-posts';
- $wrap_classes[] = wolmart_get_col_class(
- array(
- 'md' => 1,
- 'sm' => 1,
- 'min' => 1,
- )
- );
- } else {
- $cols_cnt = wolmart_get_responsive_cols( array( 'lg' => intval( $wolmart_layout['posts_column'] ) ) );
- $cols_cnt['min'] = 1;
- $wrap_classes[] = wolmart_get_col_class( $cols_cnt );
- }
- // Loadmore Button or Pagination
- if ( 1 < $wp_query->max_num_pages ) {
- if ( 'scroll' == $wolmart_layout['loadmore_type'] ) {
- $wrap_classes[] = 'load-scroll';
- }
- $wrap_attrs .= ' ' . wolmart_loadmore_attributes( '', array( 'blog' => true ), 'page', $wp_query->max_num_pages );
- }
- // Print Posts
- $wrap_classes = apply_filters( 'wolmart_post_loop_wrapper_classes', $wrap_classes );
- echo '<div class="' . esc_attr( implode( ' ', $wrap_classes ) ) . '"' . $wrap_attrs . ( $post_type ? ' data-post-type="' . $post_type . '"' : '' ) . '>';
- });
- add_action( 'wcfmmp_store_article_template', function() {
- wolmart_get_template_part( 'posts/post', null, array( 'single' => false ) );
- });
- add_action( 'wcfmmp_after_store_article_loop', function( $store_id, $store_info ) {
- echo '</div>';
- }, 50, 2);
- add_action( 'wcfmmp_store_article_template_none', function() {
- ?>
- <h2 class="entry-title"><?php esc_html_e( 'Nothing Found', 'wolmart' ); ?></h2>
- <?php
- });
- add_action( 'wcfmmp_after_store_article', function() {
- do_action( 'wolmart_print_after_page_layout' );
- echo '</div>';
- } );
- add_filter( 'wcfm_is_allow_store_articles', '__return_true' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement