= 1 && intval( $columns ) <= 5 ) ? intval( $columns ) : 4; // Create a custom WP Query $count = intval( $count ); $query_args = array(); $query_args['posts_per_page'] = ( empty( $count ) ) ? 7 : $count; if ( $category ) $query_args['category'] = $category; $query_args['meta_query'] = array( array( 'key' => '_thumbnail_id', 'compare' => 'EXISTS' ), ); $query_args = apply_filters( 'maghoot_post_grid_query', $query_args, $instance, $before_title, $title, $after_title ); $post_grid_query = get_posts( $query_args ); // Temporarily remove read more links from excerpts maghoot_remove_readmore_link(); // Add Pagination if ( !function_exists( 'maghoot_post_grid_pagination' ) ) : function maghoot_post_grid_pagination( $post_grid_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( $title ) ) ? ' view-all-withtitle' : ''; echo '
' . __( 'View All', 'magazine-hoot' ) . '
'; } } endif; if ( $viewall == 'top' ) { add_action( 'maghoot_post_grid_start', 'maghoot_post_grid_pagination', 10, 2 ); remove_action( 'maghoot_post_grid_end', 'maghoot_post_grid_pagination', 10, 2 ); } elseif ( $viewall == 'bottom' ) { add_action( 'maghoot_post_grid_end', 'maghoot_post_grid_pagination', 10, 2 ); remove_action( 'maghoot_post_grid_start', 'maghoot_post_grid_pagination', 10, 2 ); } else { remove_action( 'maghoot_post_grid_start', 'maghoot_post_grid_pagination', 10, 2 ); remove_action( 'maghoot_post_grid_end', 'maghoot_post_grid_pagination', 10, 2 ); } // Template modification Hook do_action( 'maghoot_post_grid_wrap', $post_grid_query, $query_args ); ?>
> '' ); $thumbnail_size = maghoot_thumbnail_size( $img_size, false ); $thumbnail_url = get_the_post_thumbnail_url( null, $thumbnail_size ); if ( $thumbnail_url ) $gridimg_attr['style'] .= "background-image:url('" . esc_url($thumbnail_url) . "');"; if ( $gridunit_height ) $gridimg_attr['style'] .= 'height:' . esc_attr( $gridunit_height * $factor ) . 'px;'; ?>
>
'; ?>
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_post_gridunit_catlabel', '
' . esc_html( $catname ) . '
', $catid, $caturl, $catname ); } } ?>

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

'; ?>