' . $prepend . '
';
$post__in = $post_ids;
$post_parent__in = array();
$post_parent__not_in = array();
if ( $post_type == 'child-pages' || $display_posts == 'children' ) {
$post_parent__in = $post_ids;
$post__in = array();
}
if ( $show_all ) {
$post__in = array();
$post_parent__in = array('0');
}
if ( $show_all && $display_posts == 'children' ) {
$post__in = array();
$post_parent__in = array();
$post_parent__not_in = array('0');
}
$paged = get_query_var('paged') ? get_query_var('paged') : get_query_var('page');
$args = array(
'posts_per_page' => $posts_per_page,
'post_type' => $post_type,
'post_parent__in' => $post_parent__in,
'post_parent__not_in'=> $post_parent__not_in,
'post__in' => $post__in,
'orderby' => $orderby,
'order' => $order,
'paged' => $paged,
'ignore_sticky_posts' => 1
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
$output .= '
';
while ( $the_query->have_posts() ) {
$the_query->the_post();
$url = $attributes['include_permalink'] ? '
' : null;
$title = $attributes['include_title'] ? '<' . $title_element . ' class="' . esc_attr( $text_color ) . '">' . get_the_title() . '' . $title_element . '>' : null;
$excerpt = $attributes['include_excerpt'] ? '
' . get_the_excerpt() . '
' : null;
$content = '
' . $title . $excerpt . '
';
$media = '';
if ( $include_media ) {
if ( $media_layout == 'inline' && get_the_post_thumbnail() ) {
$media .= '
';
$media .= '
';
$media .= get_the_post_thumbnail();
$media .= '
';
$media .= '
';
} elseif ( $media_layout == 'background' ) {
$image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
$attributes['background_display'] = true;
$attributes['background_image'] = array( 'url' => !empty( $image[0] ) ? $image[0] : null );
$attributes['background_color'] = $attributes['item_background_color'];
$attributes['background_display_overlay'] = esc_attr( $attributes['item_display_overlay'] );
$attributes['background_overlay'] = $attributes['item_overlay'];
$allow_pattern = false;
$media .= include( AREOI__PLUGIN_DIR . '/blocks/_partials/background.php' );
}
}
$card_class = trim(
areoi_get_class_name_str( array(
'card-body',
'd-flex',
'position-relative',
( !empty( $attributes['item_vertical_align_xs'] ) ? $attributes['item_vertical_align_xs'] : '' ),
( !empty( $attributes['item_vertical_align_sm'] ) ? $attributes['item_vertical_align_sm'] : '' ),
( !empty( $attributes['item_vertical_align_md'] ) ? $attributes['item_vertical_align_md'] : '' ),
( !empty( $attributes['item_vertical_align_lg'] ) ? $attributes['item_vertical_align_lg'] : '' ),
( !empty( $attributes['item_vertical_align_xl'] ) ? $attributes['item_vertical_align_xl'] : '' ),
( !empty( $attributes['item_vertical_align_xxl'] ) ? $attributes['item_vertical_align_xxl'] : '' ),
( !empty( $attributes['item_horizontal_align_xs'] ) ? $attributes['item_horizontal_align_xs'] : '' ),
( !empty( $attributes['item_horizontal_align_sm'] ) ? $attributes['item_horizontal_align_sm'] : '' ),
( !empty( $attributes['item_horizontal_align_md'] ) ? $attributes['item_horizontal_align_md'] : '' ),
( !empty( $attributes['item_horizontal_align_lg'] ) ? $attributes['item_horizontal_align_lg'] : '' ),
( !empty( $attributes['item_horizontal_align_xl'] ) ? $attributes['item_horizontal_align_xl'] : '' ),
( !empty( $attributes['item_horizontal_align_xxl'] ) ? $attributes['item_horizontal_align_xxl'] : '' ),
( !empty( $attributes['item_text_align_xs'] ) ? $attributes['item_text_align_xs'] : '' ),
( !empty( $attributes['item_text_align_sm'] ) ? $attributes['item_text_align_sm'] : '' ),
( !empty( $attributes['item_text_align_md'] ) ? $attributes['item_text_align_md'] : '' ),
( !empty( $attributes['item_text_align_lg'] ) ? $attributes['item_text_align_lg'] : '' ),
( !empty( $attributes['item_text_align_xl'] ) ? $attributes['item_text_align_xl'] : '' ),
( !empty( $attributes['item_text_align_xxl'] ) ? $attributes['item_text_align_xxl'] : '' ),
$text_color,
) )
);
$class = trim(
areoi_get_class_name_str( array(
'areoi-content-grid-item',
$include_media,
( !empty( $attributes['card_size'] ) ? esc_attr( $attributes['card_size'] ) : 'areoi-card-small' ),
) )
);
switch ( $style ) {
case 'full':
$output .= '
' . $media . '
' . $content . '
' . $url . '
';
break;
case 'flush':
$output .= '
' . $media . '
' . $content . '
' . $url . '
';
break;
default:
$output .= '
' . $media . '
' . $content . '
' . $url . '
';
break;
}
}
$output .= '
';
if ( $include_pagination ) {
$big = 999999999;
$pages = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, $paged ),
'total' => $the_query->max_num_pages,
) );
$pages = str_replace( 'page-numbers', 'page-numbers btn ' . $pagination_color, $pages );
$pages = str_replace( 'current', 'current active', $pages );
$output .= '