= 1 && intval( $columns ) <= 3 ) ? intval( $columns ) : 1; // Create a custom WP Query $posts_per_page = 0; for ( $ci = 1; $ci <= 3; $ci++ ) { ${ 'count' . $ci } = intval( ${ 'count' . $ci } ); ${ 'count' . $ci } = empty( ${ 'count' . $ci } ) ? 3 : ${ 'count' . $ci }; if ( $ci <= $columns ) $posts_per_page += ${ 'count' . $ci }; } $query_args = array(); $query_args['posts_per_page'] = $posts_per_page; if ( $category ) $query_args['category'] = $category; if ( $offset ) $query_args['offset'] = $offset; $query_args = apply_filters( 'maghoot_posts_list_query', $query_args, $instance, $before_title, $title, $after_title ); $posts_list_query = get_posts( $query_args ); // Temporarily remove read more links from excerpts if ( apply_filters( 'maghoot_posts_list_remove_readmore', true ) ) maghoot_remove_readmore_link(); // Add Pagination if ( !function_exists( 'maghoot_posts_list_pagination' ) ) : function maghoot_posts_list_pagination( $posts_list_query, $query_args ) { global $hybridext_currentwidget; if ( !empty( $hybridext_currentwidget['instance'] ) ) extract( $hybridext_currentwidget['instance'], EXTR_SKIP ); if ( !empty( $viewall ) ) { $base_url = ( !empty( $query_args['category'] ) ) ? esc_url( get_category_link( $query_args['category'] ) ) : ( ( get_option( 'page_for_posts' ) ) ? esc_url( get_permalink( get_option( 'page_for_posts' ) ) ) : esc_url( home_url('/') ) ); $class = sanitize_html_class( 'view-all-' . $viewall ); if ( $viewall == 'top' ) $class .= ( !empty( $category ) || !empty( $title ) ) ? ' view-all-withtitle' : ''; echo '
' . __( 'View All', 'magazine-hoot' ) . '
'; } } endif; if ( $viewall == 'top' ) { add_action( 'maghoot_posts_list_start', 'maghoot_posts_list_pagination', 10, 2 ); remove_action( 'maghoot_posts_list_end', 'maghoot_posts_list_pagination', 10, 2 ); } elseif ( $viewall == 'bottom' ) { add_action( 'maghoot_posts_list_end', 'maghoot_posts_list_pagination', 10, 2 ); remove_action( 'maghoot_posts_list_start', 'maghoot_posts_list_pagination', 10, 2 ); } else { remove_action( 'maghoot_posts_list_start', 'maghoot_posts_list_pagination', 10, 2 ); remove_action( 'maghoot_posts_list_end', 'maghoot_posts_list_pagination', 10, 2 ); } // Template modification Hook do_action( 'maghoot_posts_list_wrap', $posts_list_query, $query_args ); ?>
'; } /* Display Title */ if ( $title ) echo wp_kses_post( apply_filters( 'maghoot_widget_title', $before_title . $title . $after_title, 'posts-list', $title, $before_title, $after_title ) ); // Template modification Hook do_action( 'maghoot_posts_list_start', $posts_list_query, $query_args ); // Variables global $post; $postcount = $colcount = 1; $count = $count1; $lastclass = ( $colcount == $columns ) ? 'hcol-last' : ''; ?>
">
> 'posts-listunit-image' ); if ( $factor == 'large' && $firstpost['size'] == 'full' ) { $gridimg_attr['class'] .= ' posts-listunit-nobg'; } else { $gridimg_attr['class'] .= ' posts-listunit-bg'; $thumbnail_size = maghoot_thumbnail_size( $img_size, false ); $thumbnail_url = get_the_post_thumbnail_url( null, $thumbnail_size ); $gridimg_attr['style'] = "background-image:url('" . esc_url($thumbnail_url) . "');"; } ?>
> term_id ) ) ? $categories[0]->term_id : 0; } $catid = intval( $catid ); if ( $catid ) { $caturl = esc_url( get_category_link( $catid ) ); $catname = get_cat_name( $catid ); echo apply_filters( 'maghoot_posts_list_catlabel', '', $catid, $caturl, $catname ); } } maghoot_post_thumbnail( 'posts-listunit-img', $img_size, false, esc_url( get_permalink( $post->ID ) ) ); ?>

'; the_title(); echo ''; ?>

'; maghoot_meta_info_blocks( $metadisplay, 'posts-listunit-' . $postcount ); echo '
'; } if ( $showcontent == 'excerpt' ) { echo '
'; echo hybridextend_get_excerpt( $excerptlength ); echo '
'; } elseif ( $showcontent == 'content' ) { echo '
'; the_content(); echo '
'; } ?>
"; } $postcount++; endforeach; wp_reset_postdata(); ?>