* @copyright Copyright (c) 2020, AeonWP * @link https://aeonwp.com/aeonaccess * @license http://www.gnu.org/licenses/gpl-2.0.html */ if ( ! function_exists( 'aeonaccess_about_user' ) ) { /** * Displays the About section. */ function aeonaccess_about_user() { $enable_about = absint( get_theme_mod( 'aeonaccess-enable-about', 0 ) ); if ( 1 === $enable_about ) { $about_users = absint( get_theme_mod( 'aeonaccess_about_user' ) ); $aeonaccess_featured_user = get_user_by( 'ID', $about_users ); if ( ! empty( $aeonaccess_featured_user ) && is_front_page() && ! is_paged() ) { echo '
'; echo '

'; esc_html_e( 'About ', 'aeonaccess' ); if ( count_user_posts( $aeonaccess_featured_user->ID ) ) { echo '' . esc_html( $aeonaccess_featured_user->display_name ) . ''; } else { echo esc_html( $aeonaccess_featured_user->display_name ); } echo '

'; echo '
'; echo '' . get_avatar( $aeonaccess_featured_user->user_email, 300 ) . '' . esc_html( $aeonaccess_featured_user->display_name ) . ''; echo '

' . esc_html( get_user_meta( $aeonaccess_featured_user->ID, 'description', true ) ) . '

'; } echo '
'; } } } if ( ! function_exists( 'aeonaccess_breadcrumb' ) ) { /** * aeonaccess Breadcrumb * * @since AeonAccess 1.0.0 */ function aeonaccess_breadcrumb() { if ( ! is_front_page() && get_theme_mod( 'aeonaccess-breadcrumb-option', 1 ) === 1 ) { echo ''; } } } add_action( 'aeonaccess_breadcrumb_hook', 'aeonaccess_breadcrumb', 10 ); /** * aeonaccess Excerpt Length * * @since AeonAccess 1.0.0 * * @param int $length Length of the excerpt. */ function aeonaccess_excerpt_length( $length ) { if ( ! is_admin() ) { return absint( get_theme_mod( 'aeonaccess-blog-excerpt', 45 ) ); } } add_filter( 'excerpt_length', 'aeonaccess_excerpt_length', 999 ); /** * aeonaccess Add Body Class * * @since AeonAccess 1.0.0 * * @param string $classes CSS body classes. */ function aeonaccess_custom_class( $classes ) { $classes[] = 'pt-sticky-sidebar'; $sidebar = get_theme_mod( 'aeonaccess-sidebar-options' ); if ( 'no-sidebar' === $sidebar ) { $classes[] = 'no-sidebar'; } elseif ( 'left-sidebar' === $sidebar ) { $classes[] = 'has-left-sidebar'; } elseif ( 'middle-column' === $sidebar ) { $classes[] = 'middle-column'; } else { $classes[] = 'has-right-sidebar'; } return $classes; } add_filter( 'body_class', 'aeonaccess_custom_class' ); if ( ! function_exists( 'aeonaccess_go_to_top' ) ) { /** * Go to Top * * @since AeonAccess 1.0.0 */ function aeonaccess_go_to_top() { ?> 'angle-double-up' ) ); ?> __( '« Prev', 'aeonaccess' ), 'next_text' => __( 'Next »', 'aeonaccess' ), ) ); } else { echo "
"; the_posts_pagination( array( 'prev_text' => __( '« Prev', 'aeonaccess' ), 'next_text' => __( 'Next »', 'aeonaccess' ), ) ); echo '
'; } } } add_action( 'aeonaccess_action_navigation', 'aeonaccess_posts_navigation', 10 ); if ( ! function_exists( 'aeonaccess_related_post' ) ) { /** * Display related posts from same category * * @since AeonAccess 1.0.0 * * @param int $post_id ID of the Post. * @return void */ function aeonaccess_related_post( $post_id ) { if ( 0 == get_theme_mod( 'aeonaccess-related-post', 1 ) ) { return; } $categories = get_the_category( $post_id ); if ( $categories ) { $category_ids = array(); $category = get_category( $category_ids ); $categories = get_the_category( $post_id ); foreach ( $categories as $category ) { $category_ids[] = $category->term_id; } $count = $category->category_count; if ( $count > 1 ) { ?>