atts = array(
'style' => liquid_helper()->get_kit_frontend_option( 'liquid_portfolio_archive_style' ),
'horizontal_alignment' => liquid_helper()->get_kit_frontend_option( 'liquid_portfolio_horizontal_alignment' ),
'vertical_alignment' => liquid_helper()->get_kit_frontend_option( 'liquid_portfolio_vertical_alignment' ),
'grid_columns' => liquid_helper()->get_kit_frontend_option( 'liquid_portfolio_grid_columns' ),
'columns_gap' => liquid_helper()->get_kit_frontend_option( 'liquid_portfolio_columns_gap' )['size'],
'bottom_gap' => liquid_helper()->get_kit_frontend_option( 'liquid_portfolio_bottom_gap' )['size'],
'enable_parallax' => liquid_helper()->get_kit_frontend_option( 'liquid_portfolio_enable_parallax' ) ? '' : 'no',
'pagination' => 'pagination',
'css_animation' => 'none',
'disable_postformat' => 'yes',
);
$this->render( $this->atts );
}
/**
* [render description]
* @method render
* @return [type] [description]
*/
public function render( $atts, $content = '' ) {
$posts = get_posts( array(
'post_type' => 'liquid-archives',
'posts_per_page' => -1,
) );
if ( $posts ) {
foreach ( $posts as $post ) {
$condition = liquid_helper()->get_page_option( 'lqd_archives_rule', $post->ID );
if ( in_array( get_post_type(), $condition ) === true ){
echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $post->ID );
return;
}
}
}
extract( $atts );
// Locate the template and check if exists.
$located = locate_template( array(
"templates/portfolio/tmpl-$style.php"
) );
if ( ! $located ) {
return;
}
$this->grid_id = $grid_id = uniqid( 'grid-');
//Container
if ( defined( 'ELEMENTOR_VERSION' ) && is_callable( 'Elementor\Plugin::instance' ) ){
echo '
';
} else {
echo '
';
}
$before = $after = '';
if( 'masonry-creative' === $style ) {
printf( '
', $this->grid_id, $grid_columns );
echo '
';
}
else if ( $style === 'style05'){
echo '
';
echo '
';
echo '
';
echo '
';
}
else {
printf( '
', $this->grid_id );
}
$this->add_excerpt_hooks();
while( have_posts() ): the_post();
$post_classes = array( 'lqd-pf-item', $this->get_item_classes() );
if ( $style === "style05" ){
$post_classes[] = "lqd-pf-item-style-5 lqd-pf-light relative h-vh-100";
}
$post_classes = join( ' ', get_post_class( $post_classes, get_the_ID() ) );
$attributes = array(
'id' => 'post-' . get_the_ID(),
'class' => $post_classes
);
echo apply_filters( 'liquid_portfolio_before_post', $before );
include $located;
echo apply_filters( 'liquid_portfolio_after_post', $after );
endwhile;
$this->remove_excerpt_hooks();
if ( $style === 'style05'){
echo '
';
echo '
';
echo '
';
echo '
';
}
echo '
';
// Pagination
if( 'pagination' === $atts['pagination'] ) {
// Set up paginated links.
$links = paginate_links( array(
'type' => 'array',
'prev_next' => true,
'prev_text' => '
' . wp_kses( __( '', 'aihub' ), 'svg' ) . '',
'next_text' => '
' . wp_kses( __( '', 'aihub' ), 'svg' ) . ''
));
if( !empty( $links ) ) {
printf( '
', join( "\n\t
", $links ) );
}
}
if( in_array( $atts['pagination'], array( 'ajax', 'ajax2', 'ajax3', 'ajax4' ) ) && $url = get_next_posts_page_link( $GLOBALS['wp_query']->max_num_pages ) ) {
$hash = array(
'ajax' => 'btn btn-md ajax-load-more',
);
$attributes = array(
'href' => add_query_arg( 'ajaxify', '1', $url),
'rel' => 'nofollow',
'data-ajaxify' => true,
'data-ajaxify-options' => json_encode( array(
'wrapper' => '.liquid-portfolio-list .liquid-portfolio-list-row',
'items' => '> .masonry-item'
))
);
echo ' ';
}
echo '';
}
}
new Liquid_ThemePortfolio;