is_attachment_audio() ) { $attributes['itemtype'] = 'http://schema.org/AudioObject'; } elseif ( liquid_helper()->is_attachment_video() ) { $attributes['itemtype'] = 'http://schema.org/VideoObject'; } } else { $attributes['itemtype'] = 'http://schema.org/CreativeWork'; } } else { $attributes['id'] = 'post-0'; $attributes['class'] = join( ' ', get_post_class() ); } return $attributes; } add_filter( 'liquid_attr_entry-title', 'liquid_attributes_entry_title', 5 ); /** * [liquid_attributes_entry_title description] * @method liquid_attributes_entry_title * @param [type] $attributes [description] * @return [type] [description] */ function liquid_attributes_entry_title( $attributes ) { if( !class_exists( 'Liquid_Addons' ) ) { $attributes['class'] = isset( $attributes['class'] ) ? $attributes['class'] . ' lqd-lp-title mt-56 mb-16 h5 lh-125' : ''; } else { $attributes['class'] = isset( $attributes['class'] ) ? $attributes['class'] : ''; } return $attributes; } add_filter( 'liquid_attr_entry-content', 'liquid_attributes_entry_content', 5 ); /** * [liquid_attributes_entry_content description] * @method liquid_attributes_entry_content * @param [type] $attributes [description] * @return [type] [description] */ function liquid_attributes_entry_content( $attributes ) { $attributes['class'] = 'entry-content'; return $attributes; } add_filter( 'liquid_attr_entry-author', 'liquid_attributes_entry_author', 5 ); /** * [liquid_attributes_entry_author description] * @method liquid_attributes_entry_author * @param [type] $attributes [description] * @return [type] [description] */ function liquid_attributes_entry_author( $attributes ) { $attributes['class'] = 'entry-author'; $attributes['itemscope'] = 'itemscope'; $attributes['itemtype'] = 'http://schema.org/Person'; return $attributes; } add_filter( 'liquid_attr_entry-published', 'liquid_attributes_entry_published', 5 ); /** * [liquid_attributes_entry_published description] * @method liquid_attributes_entry_published * @param [type] $attributes [description] * @return [type] [description] */ function liquid_attributes_entry_published( $attributes ) { $attributes['class'] = 'entry-published updated'; $attributes['datetime'] = get_the_time( 'Y-m-d\TH:i:sP' ); // Translators: Post date/time "title" attribute. $attributes['title'] = get_the_time( esc_html_x( 'l, F j, Y, g:i a', 'post time format', 'aihub' ) ); return $attributes; } add_filter( 'liquid_attr_entry-summary', 'liquid_attributes_entry_summary', 5 ); /** * [liquid_attributes_entry_summary description] * @method liquid_attributes_entry_summary * @param [type] $attributes [description] * @return [type] [description] */ function liquid_attributes_entry_summary( $attributes ) { if( !class_exists( 'Liquid_Addons' ) ) { $attributes['class'] = 'entry-summary lqd-lp-excerpt mt-16 mb-16'; } else { $attributes['class'] = 'entry-summary'; } return $attributes; } add_filter( 'liquid_attr_entry-terms', 'liquid_attributes_entry_terms', 5 ); /** * [liquid_attributes_entry_terms description] * @method liquid_attributes_entry_terms * @param [type] $attributes [description] * @param [type] $context [description] * @return [type] [description] */ function liquid_attributes_entry_terms( $attributes ) { $context = $attributes['taxonomy']; unset( $attributes['taxonomy'] ); if ( !empty( $context ) ) { $attributes['class'] = 'entry-terms ' . sanitize_html_class( $context ); if ( 'category' === $context ) { } else if ( 'post_tag' === $context ) { } } return $attributes; } // 2. Functions ------------------------------------------------------ // // 3. Template Tags -------------------------------------------------- // /** * [liquid_post_thumbnail description] * @method liquid_post_thumbnail * @return [type] [description] */ function liquid_post_thumbnail() { if( post_password_required() || is_attachment() || ! has_post_thumbnail() || is_singular() ) { return; } echo '
'; the_post_thumbnail(); echo '
'; } /** * [liquid_post_terms description] * @method liquid_post_terms * @param array $args [description] * @return [type] [description] */ function liquid_post_terms( $args = array() ) { echo liquid_get_post_terms( $args ); } /** * [liquid_get_post_terms description] * @method liquid_get_post_terms * @param [type] $args [description] * @return [type] [description] */ function liquid_get_post_terms( $args ) { $out = ''; $defaults = array( 'post_id' => get_the_ID(), 'taxonomy' => 'category', 'text' => '%s', 'before' => '', 'after' => '', 'wrap' => '
%s
', // Translators: Separates tags, categories, etc. when displaying a post. 'sep' => esc_html_x( ', ', 'taxonomy terms separator', 'aihub' ) ); $args = wp_parse_args( $args, $defaults ); $classnames = 'lqd-lp-cat flex flex-wrap items-center list-none p-0 m-0 relative z-2'; if ( $args['solid'] ) { $classnames .= 'lqd-lp-cat-shaped lqd-lp-cat-solid'; } $terms = get_the_term_list( $args['post_id'], $args['taxonomy'], '' ); if ( $terms ) { $out .= $args['before']; $out .= sprintf( $args['wrap'], liquid_helper()->get_attr( 'entry-terms', array( 'taxonomy' => $args['taxonomy'] ) ), sprintf( $args['text'], $terms ) ); $out .= $args['after']; } return $out; } /** * [liquid_post_title_description description] * @method liquid_post_title_description * @return [type] [description] */ function liquid_post_title_description() { $title = $desc = ''; if ( is_home() && ! is_front_page() ) { $title = get_post_field( 'post_title', get_queried_object_id() ); $desc = get_post_field( 'post_content', get_queried_object_id(), 'raw' ); } elseif ( is_category() ) { $title = single_cat_title( '', false ); $desc = get_term_field( 'description', get_queried_object_id(), 'category', 'raw' ); } elseif ( is_tag() ) { $title = single_tag_title( '', false ); $desc = get_term_field( 'description', get_queried_object_id(), 'post_tag', 'raw' ); } elseif ( is_tax() ) { $title = single_term_title( '', false ); $desc = get_term_field( 'description', get_queried_object_id(), get_query_var( 'taxonomy' ), 'raw' ); } elseif ( is_author() ) { $title = get_the_author_meta( 'display_name', absint( get_query_var( 'author' ) ) ); $desc = get_the_author_meta( 'description', get_query_var( 'author' ) ); } elseif ( is_search() ) $title = sprintf( esc_html__( 'Search results for “%s”', 'aihub' ), get_search_query() ); elseif ( is_post_type_archive() ) { $title = post_type_archive_title( '', false ); $desc = get_post_type_object( get_query_var( 'post_type' ) )->description; } elseif ( get_query_var( 'minute' ) && get_query_var( 'hour' ) ) $title = get_the_time( esc_html_x( 'g:i a', 'minute and hour archives time format', 'aihub' ) ); elseif ( get_query_var( 'minute' ) ) $title = sprintf( esc_html__( 'Minute %s', 'aihub' ), get_the_time( esc_html_x( 'i', 'minute archives time format', 'aihub' ) ) ); elseif ( get_query_var( 'hour' ) ) $title = get_the_time( esc_html_x( 'g a', 'hour archives time format', 'aihub' ) ); elseif ( is_day() ) $title = get_the_date( esc_html_x( 'F j, Y', 'daily archives date format', 'aihub' ) ); elseif ( get_query_var( 'w' ) ) $title = sprintf( esc_html__( 'Week %1$s of %2$s', 'aihub' ), get_the_time( esc_html_x( 'W', 'weekly archives date format', 'aihub' ) ), get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'aihub' ) ) ); elseif ( is_month() ) $title = single_month_title( ' ', false ); elseif ( is_year() ) $title = get_the_date( esc_html_x( 'Y', 'yearly archives date format', 'aihub' ) ); elseif ( is_archive() ) $title = hesc_html__( 'Archives', 'aihub' ); return array( $title, $desc ); }