atts['grid_columns'];
$hash = array(
'1' => '12',
'2' => '6',
'3' => '4',
'4' => '3',
'6' => '2'
);
if ( ! empty( $hash[ $column ] ) ) {
$col = $hash[ $column ];
if ( $col !== '12' ) {
$col .= ' col-sm-6';
}
return sprintf( 'col-md-%s', $col );
}
return 'col-md-12';
}
/**
* [entry_term_classes description]
* @method entry_term_classes
* @return [type] [description]
*/
protected function entry_term_classes() {
$postcats = get_the_category();
$cat_slugs = array();
if ( count( $postcats ) > 0 ) :
foreach ( $postcats as $postcat ):
$cat_slugs[] = $postcat->slug;
endforeach;
endif;
return implode( ' ', $cat_slugs );
}
protected function entry_tags( $classes = '' ) {
$show_meta = $this->atts['show_meta'];
if( 'no' === $show_meta ) {
return;
}
global $post;
$out = '';
$meta_type = $this->atts['meta_type'];
$one_category = $this->atts['one_category'];
$style = $this->atts['style'];
$tags_list = wp_get_post_tags( $post->ID );
$rel = 'rel="tag"';
if( 'cats' === $meta_type ) {
$tags_list = get_the_category( $post->ID );
$rel = 'rel="category"';
}
$before = '
';
$before_link = '';
$after_link = '';
$before_label = '';
$after_label = '';
if ( $tags_list ) {
$out .= $before;
if( 'yes' === $one_category ) {
if( 'style05' == $this->atts['style'] ) {
$out .= '' . $before_label . esc_html( $tags_list['0']->name ) . $after_label . '';
}
elseif( 'style01' == $this->atts['style'] || 'style02' == $this->atts['style'] || 'style02-alt' == $this->atts['style'] || 'style03' == $this->atts['style'] || 'style06' == $this->atts['style'] || 'style06-alt' == $this->atts['style'] || 'style11' == $this->atts['style'] || 'style15' == $this->atts['style'] || 'style23' == $this->atts['style'] ) {
$out .= '' . $before_label . esc_html( $tags_list['0']->name ) . $after_label . '';
}
elseif( 'style10' == $this->atts['style'] ) {
$out .= '' . $before_label . esc_html( $tags_list['0']->name ) . $after_label . '';
}
else {
$out .= '' . $before_label . esc_html( $tags_list['0']->name ) . $after_label . '';
}
}
else {
foreach( $tags_list as $tag ) {
if( 'style05' == $this->atts['style'] ) {
$out .= '' . $before_label . esc_html( $tag->name ) . $after_label . '';
}
elseif( 'style01' == $this->atts['style'] || 'style02' == $this->atts['style'] || 'style02-alt' == $this->atts['style'] || 'style03' == $this->atts['style'] || 'style06' == $this->atts['style'] || 'style06-alt' == $this->atts['style'] || 'style11' == $this->atts['style'] || 'style15' == $this->atts['style'] || 'style23' == $this->atts['style'] ) {
$out .= '' . $before_label . esc_html( $tag->name ) . $after_label . '';
}
elseif( 'style10' == $this->atts['style'] ) {
$out .= '' . $before_label . esc_html( $tag->name ) . $after_label . '';
}
else {
$out .= '' . $before_label . esc_html( $tag->name ) . $after_label . '';
}
}
}
$out .= $after;
}
if( $out ) {
printf( '%1$s %2$s
',
_x( 'Tags', 'Used before tag names.', 'aihub-core' ),
$out
);
}
}
protected function entry_terms( $term = '', $classes = '' ) {
global $post;
$term_list = wp_get_object_terms( $post->ID, $term );
$out = '';
$before = '';
$before_link = '';
$after_link = '';
$before_label = '';
$after_label = '';
$rel = 'rel="category"';
if ( $term_list ){
$out .= $before;
if ( $term === 'liquid-listing-category' ){
$before_label = '';
} elseif ( $term === 'liquid-listing-location' ){
$before_label = '';
}
foreach( $term_list as $term ) {
$out .= '' . $before_label . esc_html( $term->name ) . $after_label . '';
}
$out .= $after;
}
if ( $out ){
echo $out;
}
}
protected function entry_time() {
printf( '';
}
protected function entry_title( $classes = '' ) {
$style = $this->atts['style'];
$format = get_post_format();
if ( 'link' !== $format && is_single() ) {
the_title( '', '
' );
return;
}
$url = 'link' == $format ? get_post_meta( get_the_ID(), 'post-link-url', true ) : get_permalink();
$target = 'link' == $format ? 'target="_blank"' : '';
the_title( sprintf( '' );
}
protected function overlay_link() {
$format = get_post_format();
$url = 'link' == $format ? get_post_meta( get_the_ID(), 'post-link-url', true ) : get_permalink();
$target = 'link' == $format ? 'target="_blank"' : '';
echo '';
}
protected function entry_thumbnail( $size = 'liquid-thumbnail', $attr = '', $background = false ) {
//Check
if ( post_password_required() || is_attachment() ) {
return;
}
$figure_classnames = '';
if( 'rounded' === $this->atts['style'] ) {
$figure_classnames = 'rounded';
}
elseif( 'square' === $this->atts['style'] ) {
$figure_classnames = 'round';
}
$src = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full', false );
$src = liquid_get_resized_image_src( $src, $size );
$format = get_post_format();
$style = $this->atts['style'];
$url = 'link' == $format ? get_post_meta( get_the_ID(), 'post-link-url', true ) : get_permalink();
$target = 'link' == $format ? 'target="_blank"' : '';
if( has_post_thumbnail() ) {
if( 'style01' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style1-lb', array( 'class' => 'w-full' ), true );
echo '
';
}
elseif( 'style02-alt' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style3-lb', array( 'class' => 'w-full' ), true );
echo '';
echo ' ';
}
elseif( 'style03' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style1-lb', array( 'class' => 'w-full' ), true );
echo '';
echo ' ';
}
elseif( 'style04' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style4-lb', array( 'class' => 'w-full' ), true );
echo '
';
}
elseif( 'style05' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style5-lb', array( 'class' => 'w-full' ), true );
echo '
';
}
elseif( 'style06' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style6-lb', array( 'class' => 'w-full' ), true );
echo '';
}
elseif( 'style06-alt' == $this->atts['style'] || 'style23' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style6-alt-lb', array( 'class' => 'w-full' ), true );
echo '';
}
elseif( 'style07' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style5-lb', array( 'class' => 'w-full' ), true );
echo '
';
}
elseif( 'style09' == $this->atts['style'] ) {
liquid_the_post_thumbnail( 'liquid-style9-lb', array( 'class' => 'w-full' ), true );
}
elseif( 'style10' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style5-lb', array( 'class' => 'w-full' ), true );
echo '
';
}
elseif( 'style11' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style5-lb', array( 'class' => 'w-full' ), true );
echo '
';
}
elseif( 'style13' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style5-lb', array( 'class' => 'w-full' ), true );
echo '';
}
elseif( 'style14' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style5-lb', array( 'class' => 'w-full' ), true );
echo '';
}
elseif( 'style17' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style18-lb', array( 'class' => 'w-full' ), true );
echo '';
}
elseif( 'style16' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( $size, array( 'class' => 'w-full' ), true );
echo '';
}
elseif( 'style18' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style18-lb', array( 'class' => 'w-full' ), true );
echo '';
}
elseif( 'style19' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style1-lb', array( 'class' => 'w-full' ), true );
echo '';
}
elseif( 'style20' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style1-lb', array( 'class' => 'w-full' ), true );
echo '';
}
elseif( 'style21' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( 'liquid-style1-lb', array( 'class' => 'w-full' ), true );
echo '
';
echo '';
}
elseif( 'style22' == $this->atts['style'] || 'style22-alt' == $this->atts['style'] ) {
printf( '' );
liquid_the_post_thumbnail( $size, array( 'class' => 'w-full' ), true );
echo '';
}
else {
printf( '', $figure_classnames );
liquid_the_post_thumbnail( $size, $attr, true );
echo '';
}
}
}
protected function entry_content( $class = '' ) {
$style = $this->atts['style'];
if( empty( $class ) ) {
$class = 'lqd-lp-excerpt w-80 mb-3';
}
if( !is_single() ) :
?>
', '', false )
) );
wp_link_pages( array(
'before' => '
' . __( 'Pages:', 'aihub-core' ) . '',
'after' => '
',
'link_before' => '
',
'link_after' => '',
'pagelink' => '
' . __( 'Page', 'aihub-core' ) . ' %',
'separator' => '
, ',
) );
?>
atts['post_excerpt_length'] ) ) {
return '20';
}
return $this->atts['post_excerpt_length'];
}
public function excerpt_more( $more ) {
if( !isset( $this->atts['post_excerpt_length'] ) ) {
return $more;
}
return '';
}
public function clean_excerpt() {
return false;
}
public function entry_read_more_button() {
return 'yes';
}
}
new LQD_Blog;