getThemeMod( 'header_contact_info_phone_number' ); $header_contact_info_message_above_number = ace()->getThemeMod( 'header_contact_info_message_above_number' ); $header_contact_info_message_below_number = ace()->getThemeMod( 'header_contact_info_message_below_number' ); echo '
'; echo '
'; echo ''; echo $header_contact_info_message_above_number; echo ''; echo ''; echo $header_contact_info_phone_number; echo ''; echo ''; echo $header_contact_info_message_below_number; echo ''; echo '
'; echo '
'; } /** * Nav **/ public static function headerNavi() { } /** * Archive **/ /** * Blog */ public static function renderBlogArticles( $article_type = '' ) { echo self::getBlogArticles( $article_type ); } public static function getBlogArticles( $article_type = '' ) { ob_start(); if ( in_array( $article_type, array( 'slider' ) ) ) { if ( have_posts() ) { $article_container_class = array( 'article-container', 'swiper-container' ); echo '
'; $articles_class = array( 'articles', 'post-list', 'list-in-slider', 'swiper-wrapper' ); echo '
'; while( have_posts() ) { the_post(); do_action( ace()->getPrefixedActionHook( 'render_archive_article' ), $article_type ); } echo '
'; echo '
'; do_action( ace()->getPrefixedActionHook( 'render_pagination' ) ); } else { echo '

' . esc_html__( 'No Articles.', 'ace' ) . '

'; echo '

' . esc_html__( 'Please try to search for the page with keywords.', 'ace' ) . '

'; get_search_form(); } } else { if ( have_posts() ) { $articles_class = array( 'articles', 'post-list', 'list-in-' . $article_type ); echo '
'; while( have_posts() ) { the_post(); do_action( ace()->getPrefixedActionHook( 'render_archive_article' ), $article_type ); } echo '
'; do_action( ace()->getPrefixedActionHook( 'render_pagination' ) ); } else { echo '

' . esc_html__( 'No Articles.', 'ace' ) . '

'; echo '

' . esc_html__( 'Please try to search for the page with keywords.', 'ace' ) . '

'; get_search_form(); } } $blog_articles = ob_get_clean(); return $blog_articles; } /** * Blog Article */ public static function renderBlogArticle( $article_type = '' ) { echo self::getBlogArticles( $article_type ); } public static function getBlogArticle( $article_type = '' ) { ob_start(); self::loadTemplatePart( 'archive/article', $type ); $article = ob_get_clean(); } /** * Post Item Data **/ /** * Thumbnail **/ public static function renderArchiveArticleThumbnail() { echo self::getArchiveArticleThumbnail(); } public static function getArchiveArticleThumbnail() { global $post; ob_start(); echo '
'; echo '
'; //echo ''; $thumbnailURL = esc_url( wp_get_attachment_url( get_post_thumbnail_id() ) ); $alt = $post_title = wp_strip_all_tags( get_the_title( $post->ID ) ); if ( $thumbnailURL ) { $classes = array( 'post-list-thumbnail' ); $atts = array( 'class' => implode( ' ', $classes ), 'alt' => ( $alt ? $alt : sprintf( esc_html__( 'No Titles - %s', 'ace' ), ACE_SITE_NAME ) ), 'title' => ( $post_title !== '' ? $post_title : sprintf( esc_html__( 'No Titles - %s', 'ace' ), esc_html( ACE_SITE_NAME ) ) ), ); $width = absint( ace()->getThemeMod( 'archive_page_post_thumbnail_width' ) ); $height = absint( ace()->getThemeMod( 'archive_page_post_thumbnail_height' ) ); $size = $width . 'px ' . $height . 'px'; echo get_the_post_thumbnail( $post->ID, $size, $atts ); unset( $atts ); } else { $classes = array( 'post-list-thumbnail', 'default' ); $default_cat_thumbnail = AceFrontendRenderingMethods::getTheDefaultThumbnailUrl( $post ); AceFrontendRenderingMethods::imgTagDefaultThumbnail( implode( ' ', $classes ), array( 'width' => absint( ace()->getThemeMod( 'archive_page_post_thumbnail_width' ) ) . 'px', 'height' => absint( ace()->getThemeMod( 'archive_page_post_thumbnail_height' ) ) . 'px' ), $alt, esc_url( $default_cat_thumbnail ) ); unset( $default_cat_thumbnail ); } unset( $thumbnailURL, $alt, $id, $class ); //echo ''; echo '
'; echo '
'; $html = ob_get_clean(); return apply_filters( ace()->getPrefixedFilterHook( 'render_post_list_item_thumbnail' ), $html, $post ); } /** * Author **/ public static function renderArchiveArticleAuthor() { echo self::getArchiveArticleAuthor(); } public static function getArchiveArticleAuthor() { global $post; ob_start(); echo '

'; echo '' . esc_html( get_the_author() ) . ''; echo '

'; $html = ob_get_clean(); return apply_filters( ace()->getPrefixedFilterHook( 'archive_article_author' ), $html ); } /** * Date Publish **/ public static function renderArchiveArticleDatePublished() { echo self::getArchiveArticleDatePublished(); } public static function getArchiveArticleDatePublished() { global $post; ob_start(); echo '
'; echo ''; echo '
'; $html = ob_get_clean(); return apply_filters( ace()->getPrefixedFilterHook( 'archive_article_date_published' ), $html ); } /** * Author Card **/ public static function renderAuthorCard( $user_id, $query_posts = false, $title_element = 'div', $show_post_count = false, $card_style = 'standard' ) { $author_desc = get_the_author_meta( 'user_description', $user_id ); $user_url = get_author_posts_url( $user_id ); if ( function_exists( 'bp_core_get_user_domain' ) ) { $user_url = bp_core_get_user_domain( $user_id ); } $display_name = get_the_author_meta( 'display_name', $user_id ); $post_author_atts = get_user_meta( absint( $user_id ), '_ace_post_author_atts', true ); $post_author_atts = json_decode( $post_author_atts, true ); if ( null === $post_author_atts ) $post_author_atts = array(); $post_author_atts = wp_parse_args( $post_author_atts, array( 'position' => __( 'Post Author', 'ace' ), ) ); if ( ! isset( $post_author_atts['position'] ) || '' === $post_author_atts['position'] ) { $post_author_atts['position'] = __( 'Post Author', 'ace' ); } $position = $post_author_atts['position']; $posts_total = count( get_posts( array( 'post_author' => $user_id, 'post_type' => 'post', 'posts_per_page' => -1 ) ) ); // Related Posts $has_related_posts = false; if ( false !== $query_posts ) { $posts = get_posts( $query_posts ); if ( 0 < count( $posts ) ) { $has_related_posts = true; } } // Belongs Data $has_belongs_data = false; // Avatar $avatar_url = get_avatar_url( $user_id, array( 'size' => 100, 'default' => 'mystery', ) ); $avatar_img = AceFrontendRenderingMethods::getImageTagWithNoScript( $avatar_url, $type = 'img', $atts = array( 'class' => 'author-card-avatar-image', 'alt' => sprintf( 'The Post Author: %1$s', $display_name ), 'width' => 100, 'height' => 100, ) ); $card_classes = array( 'author-card', 'style-' . $card_style ); $card_inner_classes = array( 'autor-card-inner', 'swiper-wrapper' ); if ( $has_related_posts ) { array_push( $card_classes, 'swiper-container' ); array_push( $card_classes, 'swiper-container-flip-y' ); //array_push( $card_inner_classes, 'swiper-wrapper' ); } printf( '
', implode( ' ', $card_classes ) ); printf( '
', implode( ' ', $card_inner_classes ) ); echo '
'; echo '
'; echo '<' . $title_element . ' class="author-card-title">'; echo ''; echo esc_html( $display_name ); echo ''; echo ''; echo ''; echo esc_html( $position ); echo ''; if ( $show_post_count ) { echo ''; printf( esc_html__( '%1$d Posts', 'ace' ), $posts_total ); echo ''; } echo ''; echo ''; echo '
'; echo '
'; echo '
'; echo $avatar_img; echo '
'; echo '
'; echo '
'; echo '

' . $author_desc . '

'; do_action( ace()->getPrefixedActionHook( 'render_sns_account_of_author_card_in_archive' ), $user_id ); echo '
'; echo '
'; echo '
'; echo '
'; if ( $has_related_posts ) { echo ''; } if ( $has_belongs_data ) { echo '
'; echo '
'; } echo '
'; if ( $has_related_posts ) { echo '
'; echo ''; esc_html_e( 'Flip', 'ace' ); echo ''; echo '
'; } echo '
'; } /** * Print Pagination Template for Archive Page * * @see self::getPagination() **/ public static function pagination() { echo self::getPagination(); } /** * Get Pagination Template for Archive Page * * @return string **/ public static function getPagination( $args = array() ) { if ( ! wp_is_mobile() ) { global $wp_query; $total = ( isset( $wp_query->max_num_pages ) && $wp_query->max_num_pages > 1 ? $wp_query->max_num_pages : 1 ); $current = ( get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1 ); $default_args = array( 'end_size' => 3, 'mid_size' => 3, 'prev_text' => esc_html__( '« Previous', 'ace' ), 'next_text' => esc_html__( 'Next »', 'ace' ), ); $args = wp_parse_args( $args, $default_args ); return apply_filters( ace()->getPrefixedFilterHook( 'render_pagination' ), sprintf( '', absint( $current ), absint( $total ), paginate_links( $args ) ), 'pc' ); } else { $prev = get_previous_posts_link( esc_html__( 'To Prev', 'ace' ) ); $next = get_next_posts_link( esc_html__( 'To Next', 'ace' ) ); if ( ! $prev && ! $next ) { return apply_filters( ace()->getPrefixedFilterHook( 'render_pagination' ), '', 'mobile' ); } else { if ( $prev ) { $prev = ''; } if ( $next ) { $next = '' ; } } return apply_filters( ace()->getPrefixedFilterHook( 'render_pagination' ), '', 'mobile' ); } } /** * Singular **/ /** * Render Thumbnail HTML **/ public static function singularThumbnail() { echo self::getSingularThumbnail(); } /** * Get Thumbnail HTML **/ public static function getSingularThumbnail() { global $post; $thumbnailURL = esc_url( wp_get_attachment_url( get_post_thumbnail_id() ) ); if ( false === $thumbnailURL ) { return ''; } $classes = array( 'singular-thumbnail' ); $post_title = wp_strip_all_tags( get_the_title( $post->ID ) ); $alt = $post_title = ( '' !== $post_title ? $post_title : sprintf( esc_html__( 'No Titles - %s', 'ace' ), esc_html( ACE_SITE_NAME ) ) ); $atts = array( 'class' => implode( ' ', $classes ), 'alt' => $alt, 'title' => $post_title, ); $width = 100;//absint( ace()->getThemeMod( 'archive_page_post_thumbnail_width' ) ); $height = 100;//absint( ace()->getThemeMod( 'archive_page_post_thumbnail_height' ) ); $size = $width . 'px ' . $height . 'px'; ob_start(); echo '
'; echo '
'; echo ''; echo get_the_post_thumbnail( $post->ID, $size, $atts ); unset( $atts ); echo ''; echo '
'; echo '
'; $html = ob_get_clean(); return apply_filters( ace()->getPrefixedFilterHook( 'render_singular_thumbnail' ), $html, $post ); } /** * Excerpt * * @param string $post_content * @param int $excerpt_length * * @see self::get_the_excerpt( $post_content, $excerpt_length ) **/ public static function theExcerpt( $post = null ) { echo self::getTheExcerpt( $post ); } /** * Excerpt * * @param string $post_content * @param int $excerpt_length * * @return string **/ public static function getTheExcerpt( $post = null ) { if ( empty( $post ) ) { global $post; } $post = get_post( $post ); if ( ! $post instanceof WP_Post ) return ''; $post_content = $post->post_content; $the_excerpt = preg_replace( '/\[[^\]]+]/i', '', $post_content ); $the_excerpt = wp_strip_all_tags( $the_excerpt ); $the_excerpt = str_replace( array( "\n", "\r", ' ', ' ', ' ', '"', " " ), '', $the_excerpt ); $the_excerpt = mb_ereg_replace( "/[^a-zA-Z0-9]\s[^a-zA-Z0-9]/i", '', $the_excerpt ); return mb_substr( $the_excerpt, 0, 200 ); } /** * Excerpt * * @param string $post_content * @param int $excerpt_length * * @see self::get_the_excerpt( $post_content, $excerpt_length ) **/ public static function singularPostTax( $post = null ) { echo self::getSingularPostTax( $post ); } /** * Excerpt * * @param string $post_content * @param int $excerpt_length * * @return string **/ public static function getSingularPostTax( $post = null ) { if ( empty( $post ) ) { global $post; } $post = get_post( $post ); if ( ! $post instanceof WP_Post ) return ''; ob_start(); echo '
'; self::loadTemplatePart( 'singular/tax-' . $post->post_type ); echo '
'; $html = ob_get_clean(); return apply_filters( ace()->getPrefixedFilterHook( 'render_singular_post_tax' ), $html, 'singular' ); } /** * Footer **/ public static function singularFooterPrevNext() { echo self::getSingularFooterPrevNext(); } public static function getSingularFooterPrevNext() { global $post; $post_type = get_post_type( $post ); if ( 'post' !== $post_type || is_home() || is_front_page() ) { return ''; } ob_start(); self::loadTemplatePart( 'singular/prevnext' ); $html = ob_get_clean(); return apply_filters( ace()->getPrefixedFilterHook( 'render_singular_footer_prev_next' ), $html, 'singular' ); } /** * Footer **/ /** * Footer Description **/ public static function footerNameDescription() { echo self::getFooterNameDescription(); } /** * Get Footer Description **/ public static function getFooterNameDescription() { ob_start(); echo ''; $html = ob_get_clean(); return apply_filters( ace()->getPrefixedFilterHook( 'render_footer_description' ), $html ); } /** * Footer License **/ public static function footerLicense() { echo self::getFooterLicense(); } /** * Get Footer Description **/ public static function getFooterLicense() { $license_type = AceDataMethods::getFooterLicenseType(); if ( '' === $license_type && ! is_customize_preview() ) { return ''; } ob_start(); echo ''; $html = ob_get_clean(); return apply_filters( ace()->getPrefixedFilterHook( 'render_footer_license' ), $html ); } /** * Footer Theme **/ public static function footerThemeURI() { echo self::getFooterThemeURI(); } /** * Get Footer Description **/ public static function getFooterThemeURI() { ob_start(); echo ''; $html = ob_get_clean(); return apply_filters( ace()->getPrefixedFilterHook( 'render_footer_theme_uri' ), $html ); } /** * Footer Theme **/ public static function footerCustomSiteInfo() { echo self::getFooterCustomSiteInfo(); } /** * Get Footer Description **/ public static function getFooterCustomSiteInfo() { $custom_site_info = html_entity_decode( ace()->getThemeMod( 'footer_custom_site_info' ) ); if ( ( ! is_string( $custom_site_info ) || '' === $custom_site_info ) && ! is_customize_preview() ) return ''; ob_start(); echo ''; $html = ob_get_clean(); return apply_filters( ace()->getPrefixedFilterHook( 'render_footer_custom_site_info' ), $html ); } // Buttons /** * Footer Button Set **/ public static function footerButtonSet() { echo self::getFooterButtonSet(); } public static function getFooterButtonSet() { $icon_set = apply_filters( ace()->getPrefixedFilterHook( 'footer_menu_icons' ), array( 'search' => array( 'xlink' => esc_attr( '#iconSearch' ), 'text' => esc_html__( 'Search', 'ace' ), ), 'go-to-home' => array( 'xlink' => esc_attr( '#iconHome' ), 'text' => esc_html__( 'Home', 'ace' ), ), 'scroll-to-top' => array( 'xlink' => esc_attr( '#iconChevronTop' ), 'text' => esc_html__( 'Top', 'ace' ), ), 'right-menu' => array( 'xlink' => esc_attr( '#iconMenuDots' ), 'text' => esc_html__( 'Widgets', 'ace' ), ), ) ); if ( ! is_array( $icon_set ) || 0 >= count( $icon_set ) ) { return; } ob_start(); echo ''; $html = ob_get_clean(); return apply_filters( ace()->getPrefixedFilterHook( 'render_footer_buttons' ), $html ); } /** * **/ public static function buttonWithIcon( $action, $xlink, $text, $atts = array() ) { echo self::getButtonWithIcon( $action, $xlink, $text, $atts ); } public static function getButtonWithIcon( $action, $xlink, $text, $atts = array() ) { ob_start(); printf( '' ); $html = ob_get_clean(); return apply_filters( ace()->getPrefixedFilterHook( 'render_button_with_icon' ), $html, $action, $xlink, $text ); } /** * Mods **/ // Content /** * Hooked in Filter "the_content" * @param string $the_content * @return string $the_content **/ public static function contentFilter( $content ) { // IMG Tags $content = preg_replace_callback( '/]+\/>/ims', array( 'AceFrontendRenderingMethods', 'filterImagesWithNoscript' ), $content ); $content = preg_replace( '/(\