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

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

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

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

'; } echo '
'; } } } if ( ! function_exists( 'aeonblock_breadcrumb' ) ) { /** * AeonBlock Breadcrumb * * @since AeonBlock 1.0.0 */ function aeonblock_breadcrumb() { if ( ! is_front_page() && get_theme_mod( 'aeonblock-breadcrumb-option', 1 ) == 1 ) { echo ''; } } } add_action( 'aeonblock_breadcrumb_hook', 'aeonblock_breadcrumb', 10 ); /** * AeonBlock Excerpt Length * * @since AeonBlock 1.0.0 * * @param int $length Length of the excerpt. */ function aeonblock_excerpt_length( $length ) { if ( ! is_admin() ) { return absint( get_theme_mod( 'aeonblock-blog-excerpt', 45 ) ); } } add_filter( 'excerpt_length', 'aeonblock_excerpt_length', 999 ); /** * AeonBlock Add Body Class * * @since AeonBlock 1.0.0 * * @param string $classes CSS body classes. */ function aeonblock_custom_class( $classes ) { $classes[] = 'pt-sticky-sidebar'; $sidebar = get_theme_mod( 'aeonblock-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', 'aeonblock_custom_class' ); if ( ! function_exists( 'aeonblock_go_to_top' ) ) { /** * Go to Top * * @since AeonBlock 1.0.0 */ function aeonblock_go_to_top() { if ( get_theme_mod( 'aeonblock-go-to-top', 1 ) == 1 ) { ?> 'angle-double-up' ) ); ?> __( '« Prev', 'aeonblock' ), 'next_text' => __( 'Next »', 'aeonblock' ), ) ); } else { echo "
"; the_posts_pagination( array( 'prev_text' => __( '« Prev', 'aeonblock' ), 'next_text' => __( 'Next »', 'aeonblock' ), ) ); echo '
'; } } } add_action( 'aeonblock_action_navigation', 'aeonblock_posts_navigation', 10 ); if ( ! function_exists( 'aeonblock_related_post' ) ) { /** * Display related posts from same category * * @since AeonBlock 1.0.0 * * @param int $post_id ID of the Post. * @return void */ function aeonblock_related_post( $post_id ) { if ( 0 == get_theme_mod( 'aeonblock-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 ) { ?>