$taxonomies, 'hide_empty' => true, ) ); // Build the array. if ( $terms ) { foreach ( $terms as $term ) { $items[ $term->term_id ] = esc_html($term->name); } } return $items; } /** * Get an array of posts. * * @static * @access public * @param array $args Define arguments for the get_posts function. * @return array */ public static function get_posts( $args ) { if ( is_string( $args ) ) { $args = add_query_arg( array( 'suppress_filters' => false, ) ); } elseif ( is_array( $args ) && ! isset( $args['suppress_filters'] ) ) { $args['suppress_filters'] = false; } // Get the posts. // TODO: WordPress.VIP.RestrictedFunctions.get_posts_get_posts. $posts = get_posts( $args ); // Properly format the array. $items = array(); foreach ( $posts as $post ) { $items[ $post->ID ] = $post->post_title; } wp_reset_postdata(); return $items; } /** * Get data columns with values. * * @access public * @param array $values * @return void */ public static function get_data_columns( $values = [] ) { ob_start(); if ( ! empty( $values ) ) { // Base or Mobile echo isset( $values['mobile'] ) ? ' data-columns="' . esc_attr( $values['mobile'] ) .'"' : ( isset( $values['tablet'] ) ? ' data-columns="' . esc_attr( $values['tablet'] ) .'"' : ( isset( $values['desktop'] ) ? ' data-columns="' . esc_attr( $values['desktop'] ) .'"' : '' ) ); // Tablet echo isset( $values['tablet'] ) && isset( $values['mobile'] ) ? ' data-columns-md="' . esc_attr( $values['tablet'] ) .'"' : ( isset( $values['desktop'] ) && isset( $values['tablet'] ) ? ' data-columns-md="' . esc_attr( $values['desktop'] ) .'"' : '' ); // Desktop echo isset( $values['desktop'] ) && isset( $values['tablet'] ) && isset( $values['mobile'] ) ? ' data-columns-lg="' . esc_attr( $values['desktop'] ) .'"' : ''; } $output = ob_get_clean(); echo apply_filters( 'blogin_aarambha_get_data_columns', $output ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Archive Title * * @param $before string * @param $after string * @access public * @return void */ public static function archive_title( $before = '', $after = '' ) { if ( is_category() ) { $title = sprintf( __( ' %s', 'blogin-aarambha' ), '' . single_cat_title( '', false ) . '' ); } elseif ( is_tag() ) { $title = sprintf( __( ' %s', 'blogin-aarambha' ), '' . single_tag_title( '', false ) . '' ); } elseif ( is_author() ) { $title = sprintf( __( ' %s', 'blogin-aarambha' ), '' . get_the_author() . '' ); } elseif ( is_year() ) { $title = sprintf( __( ' %s', 'blogin-aarambha' ), '' . get_the_date( esc_html_x( 'Y', 'yearly archives date format', 'blogin-aarambha' ) ) . '' ); } elseif ( is_month() ) { $title = sprintf( __( ' %s', 'blogin-aarambha' ), '' . get_the_date( esc_html_x( 'F Y', 'monthly archives date format', 'blogin-aarambha' ) ) . '' ); } elseif ( is_day() ) { $title = sprintf( __( ' %s', 'blogin-aarambha' ), '' . get_the_date( esc_html_x( 'F j, Y', 'daily archives date format', 'blogin-aarambha' ) ) . '' ); } elseif ( is_tax( 'post_format' ) ) { if ( is_tax( 'post_format', 'post-format-aside' ) ) { $title = esc_html_x( 'Asides', 'post format archive title', 'blogin-aarambha' ); } elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) { $title = esc_html_x( 'Galleries', 'post format archive title', 'blogin-aarambha' ); } elseif ( is_tax( 'post_format', 'post-format-image' ) ) { $title = esc_html_x( 'Images', 'post format archive title', 'blogin-aarambha' ); } elseif ( is_tax( 'post_format', 'post-format-video' ) ) { $title = esc_html_x( 'Videos', 'post format archive title', 'blogin-aarambha' ); } elseif ( is_tax( 'post_format', 'post-format-quote' ) ) { $title = esc_html_x( 'Quotes', 'post format archive title', 'blogin-aarambha' ); } elseif ( is_tax( 'post_format', 'post-format-link' ) ) { $title = esc_html_x( 'Links', 'post format archive title', 'blogin-aarambha' ); } elseif ( is_tax( 'post_format', 'post-format-status' ) ) { $title = esc_html_x( 'Statuses', 'post format archive title', 'blogin-aarambha' ); } elseif ( is_tax( 'post_format', 'post-format-audio' ) ) { $title = esc_html_x( 'Audio', 'post format archive title', 'blogin-aarambha' ); } elseif ( is_tax( 'post_format', 'post-format-chat' ) ) { $title = esc_html_x( 'Chats', 'post format archive title', 'blogin-aarambha' ); } } elseif ( is_post_type_archive() ) { $title = post_type_archive_title( '', false ); } elseif ( is_tax() ) { $tax = get_taxonomy( get_queried_object()->taxonomy ); /* translators: 1: Taxonomy singular name, 2: Current taxonomy term */ $title = sprintf( esc_html__( '%1$s: %2$s', 'blogin-aarambha' ), $tax->labels->singular_name, '' . single_term_title( '', false ) . '' ); } elseif ( is_singular() ) { $title = get_the_title(); } elseif ( is_404() ) { $title = esc_html__( 'Error Page', 'blogin-aarambha' ); } elseif ( is_search() ) { $title = get_search_query(); } elseif ( Blogin_Aarambha_Helper::is_woocommerce() && is_shop() ) { $title = esc_html__( 'Shop', 'blogin-aarambha' ); } else { $title = esc_html__( 'Blog', 'blogin-aarambha' ); } /** * Filter the archive title. * * @param string $title Archive title to be displayed. */ $title = apply_filters( 'get_the_archive_title', $title ); if ( ! empty( $title ) ) { echo $before . $title . $after; // WPCS: XSS OK. } } /** * Social Network Lists * * @access public * @return array */ public static function social_network_list() { return [ 'facebook' => esc_html__( 'Facebook', 'blogin-aarambha' ), 'twitter' => esc_html__( 'Twitter', 'blogin-aarambha' ) ]; } /** * Retrieves the post meta. * * @param int $post_id The ID of the post. * @param null|array $meta_list custom post meta list * @return void */ public static function post_meta( $post_id = null, $meta_list = null ) { // Require post ID. if ( ! $post_id ) { return; } /** * Filters post types array. * * @param array Array of post types */ $disallowed_post_types = apply_filters( 'blogin_aarambha_disallowed_post_meta', array( 'page' ) ); // Check whether the post type is allowed to output post meta. if ( in_array( get_post_type( $post_id ), $disallowed_post_types, true ) ) { return; } $post_meta = $meta_list ? $meta_list : get_theme_mod( 'blogin_aarambha_meta_elements', ['categories','date'] ); // If the post meta setting has the value 'empty', it's explicitly empty and the default post meta shouldn't be output. if ( $post_meta && ! in_array( 'empty', $post_meta, true ) ) { // Make sure we don't output an empty container. $has_meta = false; global $post; $the_post = get_post( $post_id ); setup_postdata( $the_post ); ob_start(); ?>
max_num_pages < 2) { return; } $pagination_type = get_theme_mod( 'blogin_aarambha_blog_pagination_type', 'nxt-prv' ); if ( $pagination_type ) : ob_start(); echo '
'; switch ( $pagination_type ) : case 'nxt-prv' : the_posts_navigation(); break; case 'numeric' : the_posts_pagination(); break; endswitch; echo '
'; $output = ob_get_clean(); echo apply_filters('blogin_aarambha_pagination_markup', $output); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped endif; } /** * Author Box * * @return void */ public static function author_box() { // Only display for standard posts if ( 'post' != get_post_type() ) { return; } // Get author data $author = get_the_author(); $author_description = get_the_author_meta( 'description' ); $author_url = esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); $author_avatar = get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'blogin_aarambha_avatar_size', 150 ) ); $author_contents = ['name','info']; ?>

ID, [ 'fields' => 'ids' ] ); if ( ! empty( $cats ) ) { $args['posts_per_page'] = 4; $args['post__not_in'] = [ $current_post->ID ]; $args['category__in'] = $cats; $args['no_found_rows'] = true; $args['ignore_sticky_posts'] = true; } $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) : // Columns per row $col_per_row = [ 'desktop' => '2', 'tablet' => '2', 'mobile' => '1' ]; ?>

> have_posts() ) : $the_query->the_post(); /* * Include the Post-Type-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Type name) and that will be used instead. */ ?>
'h1'] ) : get_theme_mod( 'blogin_aarambha_page_title_tag', ['desktop' => 'h1'] ); the_title( '<' . esc_attr( $html_tag['desktop'] ) . ' class="entry-title">', '' ); else : $html_tag = get_theme_mod( 'blogin_aarambha_blog_title_tag', ['desktop' => 'h2'] ); the_title( '<' . esc_attr( $html_tag['desktop'] ) . ' class="entry-title">', '' ); endif; } /** * Post Content * * @return void */ public static function post_content() { echo '
'; if ( is_singular() ) : the_content( sprintf( wp_kses( /* translators: %s: Name of current post. Only visible to screen readers */ __( 'Continue reading "%s"', 'blogin-aarambha' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ) ); wp_link_pages( array( 'before' => '', ) ); else : self::post_excerpt(); endif; echo '
'; } /** * Post Read More Button * * @return void */ public static function read_more() { $btn_type = get_theme_mod( 'blogin_aarambha_blog_read_more_type', ['desktop'=>'text'] ); $enable_arrow = get_theme_mod( 'blogin_aarambha_blog_read_more_arrow', '' ); $read_more_class = ['read-more']; if ( $btn_type && $btn_type['desktop'] == 'button' ) { $read_more_class[] = 'read-more-button'; } if ( $enable_arrow && array_key_exists( 'desktop' , $enable_arrow ) ) { $read_more_class[] = 'd-flex align-items-center'; } ob_start(); ?>
'button'] ); $enable_arrow = get_theme_mod( 'blogin_aarambha_banner_read_more_arrow', '' ); $read_more_class = ['read-more']; if ( $btn_type && $btn_type['desktop'] == 'button' ) { $read_more_class[] = 'read-more-button'; } if ( $enable_arrow && array_key_exists( 'desktop' , $enable_arrow ) ) { $read_more_class[] = 'd-flex align-items-center'; } ob_start(); ?>