tag for Masonary blog post
articled_is_masonry('top');
// started WordPress loop
if( have_posts() ) {
while( have_posts() ) :
the_post();
echo '';
echo load_template( apply_filters( 'articled_blog_' . $page, $path ), false );
echo '';
endwhile;
} else {
echo '
' . _e('Opppp! Sorry No Content', 'articled') . '
';
}
articled_is_masonry('bottom');
}
}
if( ! function_exists('articled_pagination') ){
function articled_pagination(){
// blog post Pagination e.g page 1 2 3 4
$paginate_args = [
'prev_text' => '',
'next_text' => '',
'type' => 'list',
'add_args' => false,
'add_fragment' => '',
'before_page_number' => '',
'after_page_number' => ''
];
echo '';
}
}
if( ! function_exists('articled_sidebar') ){
function articled_sidebar($opt = true){
if( ! $opt ) return;
echo '';
echo '';
echo '';
echo '
';
echo '';
return;
}
}
// Thumbnail Images function_exists
if( !function_exists('articled_classic_thumbnail') ) :
function articled_classic_thumbnail( $data_src = 'thumbnail', $scr = 'thumbnail', $default = null) {
if( has_image_size( $scr )){
$img_src = esc_url( get_the_post_thumbnail_url( get_the_ID(), $scr ) );
} else {
$img_src = esc_url( get_the_post_thumbnail_url( get_the_ID(), 'medium' ) );
}
$img_data_data = esc_url( get_the_post_thumbnail_url( get_the_ID(), $data_src ) );
$data_src_small = esc_url( get_the_post_thumbnail_url( get_the_ID(), 'articled_data_src_small' ) );
$data_src_medium = esc_url( get_the_post_thumbnail_url( get_the_ID(), 'articled_data_src_medium' ) );
$data_src_large = esc_url( get_the_post_thumbnail_url( get_the_ID(), 'articled_data_src_large' ) );
if ( !$default = null ) {
$thumbnail = $default;
}
$img_title = get_the_title( get_post_thumbnail_id() );
$img_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
if(!empty($img_alt)){
$img_alt = $img_alt;
} else {
$img_alt = $img_title;
}
if ( has_post_thumbnail() && strlen(get_the_post_thumbnail()) ) {
// If Post has Thumbnail
$thumbnail = '
'
.''
.'';
} else {
// If, It is not page
if(!is_page()){
// If Post doesn't has Thumbnail, then SHow default Images
$thumbnail = '
';
}
}
// return final thumnail to echo out
return $thumbnail;
}
endif;
if( ! function_exists('articled_header')){
function articled_header( $header = '' ){
global $articled_options;
$header = ARTICLED_HEADER . 'header-' . ( empty( $header ) ? abu_ekey( 'header_type', $articled_options, '1' ) : $header ) . '/header.php';
$header = apply_filters( 'articled_header_path', $header );
return load_template( $header, true );
}
}