/
var
/
www
/
barefootlaw.org
/
wp-content
/
themes
/
archub
/
liquid
/
structure
/
Upload File
HOME
<?php /** * LiquidThemes Theme Framework */ if( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly /** * Table of content * * 1. Hooks * 2. Functions * 3. Template Tags */ // 1. Hooks ------------------------------------------------------ // add_filter( 'liquid_attr_post', 'liquid_attributes_post' ); add_filter( 'liquid_attr_entry', 'liquid_attributes_post' ); /** * [liquid_attributes_post description] * @method liquid_attributes_post * @param [type] $attributes [description] * @return [type] [description] */ function liquid_attributes_post( $attributes ) { $post = get_post(); $post_type = get_post_type(); // Make sure we have a real post first. if ( ! empty( $post ) ) { $attributes['id'] = 'post-' . get_the_ID(); if( !class_exists( 'ReduxFramework' ) || !class_exists( 'Liquid_Addons' ) ) { $class = is_singular() ? 'text-start pos-rel' : 'lqd-lp-style-11 lqd-lp-hover-img-zoom text-start pos-rel'; $attributes['class'] = join( ' ', get_post_class( array( $attributes['class'], $class ) ) ); } else { $attributes['class'] = join( ' ', get_post_class( $attributes['class'] ) ); } $attributes['itemscope'] = 'itemscope'; if ( 'post' === $post_type ) { $attributes['itemtype'] = 'http://schema.org/BlogPosting'; /* Add itemprop if within the main query. */ if ( is_main_query() && ! is_search() ) { } } elseif( 'attachment' === $post_type ) { if ( wp_attachment_is_image() ) { $attributes['itemtype'] = 'http://schema.org/ImageObject'; } elseif ( liquid_helper()->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( 'ReduxFramework' ) || !class_exists( 'Liquid_Addons' ) ) { $attributes['class'] = isset( $attributes['class'] ) ? $attributes['class'] . ' lqd-lp-title mt-2 mb-3 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', 'archub' ) ); 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( 'ReduxFramework' ) || !class_exists( 'Liquid_Addons' ) ) { $attributes['class'] = 'entry-summary lqd-lp-excerpt mt-3 mb-3'; } 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 '<div class="lqd-lp-img overflow-hidden border-radius-5 mt-4 mb-5">'; the_post_thumbnail(); echo '</div>'; } /** * [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' => '<div %s>', 'after' => '</div>', 'wrap' => '', // Translators: Separates tags, categories, etc. when displaying a post. 'sep' => esc_html_x( ', ', 'taxonomy terms separator', 'archub' ) ); $args = wp_parse_args( $args, $defaults ); $classnames = 'lqd-lp-cat lqd-lp-cat lqd-lp-cat-shaped lqd-lp-cat-solid reset-ul inline-nav d-flex flex-wrap pos-rel z-index-3 font-weight-bold text-uppercase ltr-sp-1 '; if ( $args['solid'] ) { $classnames .= 'lqd-lp-cat-shaped lqd-lp-cat-solid lqd-lp-cat-solid-colored'; } $terms = get_the_terms( $args['post_id'], $args['taxonomy'] ); if ( $terms ) { $out .= sprintf( $args['before'], liquid_helper()->get_attr( 'entry-terms', array( 'taxonomy' => $args['taxonomy'] ) ) ); $out .= '<ul class="' . esc_attr($classnames) . '">'; foreach ($terms as $term) { $out .= '<li class="' . $args['taxonomy'] . '-' . $term->slug . '">'; $out .= '<a class="lh-15 circle" href="' . get_term_link( $term->slug, $args['taxonomy']) . '" rel="' . $args['taxonomy'] . '">'; $out .= $term->name; $out .= '</a>'; $out .= '</li>'; } $out .= '</ul>'; $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”', 'archub' ), 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', 'archub' ) ); elseif ( get_query_var( 'minute' ) ) $title = sprintf( esc_html__( 'Minute %s', 'archub' ), get_the_time( esc_html_x( 'i', 'minute archives time format', 'archub' ) ) ); elseif ( get_query_var( 'hour' ) ) $title = get_the_time( esc_html_x( 'g a', 'hour archives time format', 'archub' ) ); elseif ( is_day() ) $title = get_the_date( esc_html_x( 'F j, Y', 'daily archives date format', 'archub' ) ); elseif ( get_query_var( 'w' ) ) $title = sprintf( esc_html__( 'Week %1$s of %2$s', 'archub' ), get_the_time( esc_html_x( 'W', 'weekly archives date format', 'archub' ) ), get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'archub' ) ) ); elseif ( is_month() ) $title = single_month_title( ' ', false ); elseif ( is_year() ) $title = get_the_date( esc_html_x( 'Y', 'yearly archives date format', 'archub' ) ); elseif ( is_archive() ) $title = hesc_html__( 'Archives', 'archub' ); return array( $title, $desc ); }