' . "\n", get_bloginfo( 'pingback_url' ) ); } } /** * Schema for
tag. */ if ( ! function_exists( 'ast_schema_body' ) ) : /** * Adds schema tags to the body classes. * * @since 1.0.0 */ function ast_schema_body() { // Check conditions. $is_blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false; // Set up default itemtype. $itemtype = 'WebPage'; // Get itemtype for the blog. $itemtype = ( $is_blog ) ? 'Blog' : $itemtype; // Get itemtype for search results. $itemtype = ( is_search() ) ? 'SearchResultsPage' : $itemtype; // Get the result. $result = apply_filters( 'astra_schema_body_itemtype', $itemtype ); // Return our HTML. echo apply_filters( 'astra_schema_body', "itemtype='http://schema.org/" . esc_html( $result ) . "' itemscope='itemscope'" ); } endif; /** * Adds custom classes to the array of body classes. */ if ( ! function_exists( 'ast_body_classes' ) ) { /** * Adds custom classes to the array of body classes. * * @since 1.0.0 * @param array $classes Classes for the body element. * @return array */ function ast_body_classes( $classes ) { if ( wp_is_mobile() ) { $classes[] = 'ast-header-break-point'; } // Apply header layout class to the body. $classes[] = 'header-main-layout-1'; // Apply separate container class to the body. $content_layout = ast_get_content_layout(); if ( 'content-boxed-container' == $content_layout ) { $classes[] = 'ast-separate-container'; } elseif ( 'boxed-container' == $content_layout ) { $classes[] = 'ast-separate-container ast-two-container'; } elseif ( 'page-builder' == $content_layout ) { $classes[] = 'ast-page-builder-template'; } elseif ( 'plain-container' == $content_layout ) { $classes[] = 'ast-plain-container'; } // Sidebar location. $page_layout = 'ast-' . ast_page_layout(); $classes[] = $page_layout; return $classes; } }// End if(). add_filter( 'body_class', 'ast_body_classes' ); /** * Astra Pagination */ if ( ! function_exists( 'ast_number_pagination' ) ) { /** * Astra Pagination * * @since 1.0.0 * @return void Generate & echo pagination markup. */ function ast_number_pagination() { echo "' . get_bloginfo( 'description' ) . '
'; } /** * Echo or Return the Logo Markup */ if ( $echo ) { echo apply_filters( 'ast_logo', $html ); } else { return apply_filters( 'ast_logo', $html ); } } }// End if(). /** * Return the selected sections */ if ( ! function_exists( 'ast_get_dynamic_header_content' ) ) { /** * Return the selected sections * * @since 1.0.0 * @param string $option Custom content type. E.g. search, text-html etc. * @return array Array of Custom contents. */ function ast_get_dynamic_header_content( $option ) { $output = array(); $section = ast_get_option( $option ); switch ( $section ) { case 'search': $output[] = ast_get_search( $option ); break; case 'text-html': $output[] = ast_get_custom_html( $option . '-html' ); break; } return $output; } } /** * Adding Wrapper for Search Form. */ if ( ! function_exists( 'ast_get_search' ) ) { /** * Adding Wrapper for Search Form. * * @since 1.0.0 * @param string $option Search Option name. * @return mixed Search HTML structure created. */ function ast_get_search( $option = '' ) { $search_html = ' '; return apply_filters( 'ast_get_search', $search_html, $option ); } } /** * Get custom HTML added by user. */ if ( ! function_exists( 'ast_get_custom_html' ) ) { /** * Get custom HTML added by user. * * @since 1.0.0 * @param string $option_name Option name. * @return String TEXT/HTML added by user in options panel. */ function ast_get_custom_html( $option_name = '' ) { $custom_html = ''; $custom_html_content = ast_get_option( $option_name ); if ( ! empty( $custom_html_content ) ) { $custom_html = '' . '
'; $fields['url'] = ''; return $fields; } } add_filter( 'comment_form_default_fields', 'ast_comment_form_default_fields_markup' ); /** * Function to filter comment form arguments */ if ( ! function_exists( 'ast_comment_form_default_markup' ) ) { /** * Function filter comment form arguments * * @since 1.0.0 * @param array $args Comment form arguments. * @return array */ function ast_comment_form_default_markup( $args ) { $args['id_form'] = 'ast-commentform'; $args['title_reply'] = ast_default_strings( 'string-comment-title-reply', false ); $args['cancel_reply_link'] = ast_default_strings( 'string-comment-cancel-reply-link', false ); $args['label_submit'] = ast_default_strings( 'string-comment-label-submit', false ); $args['comment_field'] = ''; return $args; } } add_filter( 'comment_form_defaults', 'ast_comment_form_default_markup' ); /** * Function to filter comment form arguments */ if ( ! function_exists( 'ast_404_page_layout' ) ) { /** * Function filter comment form arguments * * @since 1.0.0 * @param array $layout Comment form arguments. * @return array */ function ast_404_page_layout( $layout ) { if ( is_404() ) { $layout = 'no-sidebar'; } return $layout; } } add_filter( 'ast_page_layout', 'ast_404_page_layout', 10, 1 ); /** * Return current content layout */ if ( ! function_exists( 'ast_get_content_layout' ) ) { /** * Return current content layout * * @since 1.0.0 * @return boolean content layout. */ function ast_get_content_layout() { $value = false; if ( is_singular() ) { // If post meta value is empty, // Then get the POST_TYPE content layout. $content_layout = ast_get_option_meta( 'site-content-layout', '', '', true ); if ( empty( $content_layout ) ) { $content_layout = ast_get_option( 'single-' . get_post_type() . '-content-layout', '', '' ); if ( 'default' == $content_layout || empty( $content_layout ) ) { // Get the GLOBAL content layout value. // NOTE: Here not used `true` in the below function call. $content_layout = ast_get_option( 'site-content-layout', '', 'full-width' ); } } } else { $content_layout = ast_get_option( 'archive-' . get_post_type() . '-content-layout', '', '' ); if ( is_search() ) { $content_layout = ast_get_option( 'archive-post-content-layout', '', '' ); } if ( 'default' == $content_layout || empty( $content_layout ) ) { // Get the GLOBAL content layout value. // NOTE: Here not used `true` in the below function call. $content_layout = ast_get_option( 'site-content-layout', '', 'full-width' ); } } return apply_filters( 'ast_get_content_layout', $content_layout ); } }// End if(). add_filter( 'ast_the_title_enabled', 'page_builder_disable_title', 12 ); /** * Disbale title for Page Builder template */ if ( ! function_exists( 'page_builder_disable_title' ) ) { /** * Disbale title for Page Builder template * * @since 1.0.0 * @param boolean $default Title enabled or not. * @return boolean Title enable or disable. */ function page_builder_disable_title( $default ) { $content_layout = ast_get_content_layout(); if ( 'page-builder' == $content_layout ) { $default = false; } return $default; } } /** * Display Blog Post Excerpt */ if ( ! function_exists( 'ast_the_excerpt' ) ) { /** * Display Blog Post Excerpt * * @since 1.0.0 */ function ast_the_excerpt() { $excerpt_type = ast_get_option( 'blog-post-content' ); if ( 'full-content' == $excerpt_type ) { the_content(); } else { the_excerpt(); } } }