' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) ); } } /** * Schema for
tag. */ if ( ! function_exists( 'astra_schema_body' ) ) : /** * Adds schema tags to the body classes. * * @since 1.0.0 */ function astra_schema_body() { if ( true !== apply_filters( 'astra_schema_enabled', true ) ) { return; } // 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='https://schema.org/" . esc_attr( $result ) . "' itemscope='itemscope'" ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; /** * Adds custom classes to the array of body classes. */ if ( ! function_exists( 'astra_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 astra_body_classes( $classes ) { if ( wp_is_mobile() ) { $classes[] = 'ast-header-break-point'; } else { $classes[] = 'ast-desktop'; } if ( astra_is_amp_endpoint() ) { $classes[] = 'ast-amp'; } // Apply separate container class to the body. $content_layout = astra_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-' . astra_page_layout(); $classes[] = esc_attr( $page_layout ); // Current Astra verion. $classes[] = esc_attr( 'astra-' . ASTRA_THEME_VERSION ); $menu_item = astra_get_option( 'header-main-rt-section' ); $outside_menu = astra_get_option( 'header-display-outside-menu' ); if ( 'none' !== $menu_item && $outside_menu ) { $classes[] = 'ast-header-custom-item-outside'; } else { $classes[] = 'ast-header-custom-item-inside'; } /** * Add class for header width */ $header_content_layout = astra_get_option( 'header-main-layout-width' ); if ( 'full' == $header_content_layout ) { $classes[] = 'ast-full-width-primary-header'; } return $classes; } } add_filter( 'body_class', 'astra_body_classes' ); /** * Astra Pagination */ if ( ! function_exists( 'astra_number_pagination' ) ) { /** * Astra Pagination * * @since 1.0.0 * @return void Generate & echo pagination markup. */ function astra_number_pagination() { global $wp_query; $enabled = apply_filters( 'astra_pagination_enabled', true ); // Don't print empty markup if their is only one page. if ( $wp_query->max_num_pages < 2 || ! $enabled ) { return; } ob_start(); echo "