### Color Utilities Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Functions for color manipulation, including getting contrasting foreground colors, adjusting brightness, and converting HEX to RGBA. ```APIDOC ## Color Utilities ### Description Astra provides color manipulation functions for generating foreground colors, adjusting brightness, and converting between HEX and RGBA formats. ### Functions #### `astra_get_foreground_color( $hex_color ) ##### Parameters - **hex_color** (string) - Required - The background color in HEX format. ##### Returns - (string) - Contrasting foreground color ('#ffffff' or '#000000'). ##### Example ```php // Get contrasting foreground color (black or white) $bg_color = '#336699'; $text_color = astra_get_foreground_color($bg_color); // Returns "#ffffff" $light_bg = '#f5f5f5'; $dark_text = astra_get_foreground_color($light_bg); // Returns "#000000" ``` #### `astra_adjust_brightness( $hex_color, $percentage, $type = 'lighten' ) ##### Parameters - **hex_color** (string) - Required - The base color in HEX format. - **percentage** (int) - Required - The percentage to adjust brightness. - **type** (string) - Optional - 'lighten', 'darken', or 'reverse' (auto light/dark). Defaults to 'lighten'. ##### Returns - (string) - The adjusted HEX color. ##### Example ```php // Adjust color brightness $base_color = '#336699'; $lighter = astra_adjust_brightness($base_color, 50, 'lighten'); $darker = astra_adjust_brightness($base_color, 50, 'darken'); $auto = astra_adjust_brightness($base_color, 30, 'reverse'); // Auto light/dark ``` #### `astra_hex_to_rgba( $hex, $opacity = 1 ) ##### Parameters - **hex** (string) - Required - The HEX color code. - **opacity** (float) - Optional - The opacity value (0 to 1). Defaults to 1. ##### Returns - (string) - The RGBA or RGB color string. ##### Example ```php // Convert HEX to RGBA $hex = '#336699'; $rgba = astra_hex_to_rgba($hex, 0.5); // "rgba(51,102,153,0.5)" $rgb = astra_hex_to_rgba($hex); // "rgb(51,102,153)" ``` ### Integration Example ```php // Use in dynamic CSS generation add_filter('astra_dynamic_theme_css', function($css) { $theme_color = astra_get_option('theme-color'); $hover_color = astra_adjust_brightness($theme_color, 20, 'darken'); $button_css = array( '.ast-button:hover' => array( 'background-color' => $hover_color, ), ); return $css . astra_parse_css($button_css); }); ``` ``` -------------------------------- ### Retrieve Astra Responsive Breakpoints Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Get default and modified responsive breakpoints for tablet and mobile devices using 'astra_get_tablet_breakpoint()' and 'astra_get_mobile_breakpoint()'. You can also retrieve breakpoints with an offset. ```php '#ffffff', 'background-image' => 'https://example.com/image.jpg', 'background-repeat' => 'no-repeat', 'background-position' => 'center center', 'background-size' => 'cover', 'background-attachment' => 'fixed', 'background-type' => 'image', 'overlay-type' => 'classic', 'overlay-color' => 'rgba(0,0,0,0.5)', 'overlay-opacity' => '0.5', ); $bg_css = astra_get_background_obj($bg_config); // Returns array ready for astra_parse_css(): // array( // 'background-image' => 'linear-gradient(to right, rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url(https://example.com/image.jpg)', // 'background-repeat' => 'no-repeat', // 'background-position' => 'center center', // 'background-size' => 'cover', // 'background-attachment' => 'fixed', // ) // Use in dynamic CSS add_filter('astra_dynamic_theme_css', function($css) { $header_bg = astra_get_option('header-bg-obj', array()); $bg_css_props = astra_get_background_obj($header_bg); $header_styles = array( '.site-header' => $bg_css_props, ); return $css . astra_parse_css($header_styles); }); // Responsive background handling $responsive_bg = astra_get_option('site-layout-outside-bg-obj-responsive'); $desktop_bg = astra_get_responsive_background_obj($responsive_bg, 'desktop'); $tablet_bg = astra_get_responsive_background_obj($responsive_bg, 'tablet'); $mobile_bg = astra_get_responsive_background_obj($responsive_bg, 'mobile'); ``` -------------------------------- ### Customize Astra Content Area with Hooks Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Leverage 'astra_content_before', 'astra_entry_before', 'astra_entry_content_before', and 'astra_entry_content_after' hooks to modify the content area. This includes adding breadcrumbs, share buttons, or author bios conditionally. ```php ' . get_share_buttons() . ''; } }); add_action('astra_entry_content_after', function() { if (is_single()) { echo '
' . get_author_bio() . '
'; } }); ``` -------------------------------- ### Integrate WooCommerce Features Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Customize WooCommerce shop layouts, columns, and product displays using Astra-specific hooks. Ensure compatibility checks are performed before executing logic. ```php cart->get_cart_contents_count(); return ' ' . $count . ' '; } return $content; }, 10, 3); // Filter shop page layout add_filter('astra_get_content_layout', function($layout) { if (function_exists('is_shop') && (is_shop() || is_product_category())) { return 'plain-container'; } if (function_exists('is_product') && is_product()) { return 'plain-container'; } return $layout; }); // Custom single product structure add_action('woocommerce_single_product_summary', function() { // Custom content after product summary echo '
'; // Add custom badges echo '
'; }, 35); ``` -------------------------------- ### Retrieve Theme Options with astra_get_option Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Use this function to fetch theme settings from the database, supporting default fallbacks and dynamic filtering. ```php 16, 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', )); // Get color settings using CSS variables $text_color = astra_get_option('text-color', 'var(--ast-global-color-3)'); $link_color = astra_get_option('link-color', 'var(--ast-global-color-0)'); $theme_color = astra_get_option('theme-color', 'var(--ast-global-color-0)'); // Get container layout settings $content_width = astra_get_option('site-content-width', 1200); $sidebar_width = astra_get_option('site-sidebar-width', 30); // Filter option values dynamically add_filter('astra_get_option_site-layout', function($value, $option, $default) { if (is_page_template('full-width.php')) { return 'ast-full-width-layout'; } return $value; }, 10, 3); ``` -------------------------------- ### Manipulate Colors and Themes Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Functions for calculating foreground colors, adjusting brightness, and converting color formats for use in dynamic CSS. ```php array( 'background-color' => $hover_color, ), ); return $css . astra_parse_css($button_css); }); ``` -------------------------------- ### Manage Theme Options with astra_update_option and astra_delete_option Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Programmatically update or delete theme settings, utilizing action hooks to trigger logic before or after changes. ```php array('top' => 20, 'right' => 30, 'bottom' => 20, 'left' => 30), 'tablet' => array('top' => 15, 'right' => 20, 'bottom' => 15, 'left' => 20), 'mobile' => array('top' => 10, 'right' => 15, 'bottom' => 10, 'left' => 15), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ), 'top', 'desktop' ); // Returns: "20px" ``` -------------------------------- ### Generate Responsive CSS with Astra Breakpoints Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Use 'astra_parse_css' in conjunction with 'astra_get_tablet_breakpoint()' and 'astra_get_mobile_breakpoint()' within the 'astra_dynamic_theme_css' filter to generate responsive CSS rules for different screen sizes. ```php array('font-size' => '18px'), ); $css .= astra_parse_css($desktop); // Tablet styles (max-width: tablet breakpoint) $tablet = array( '.my-element' => array('font-size' => '16px'), ); $css .= astra_parse_css($tablet, '', astra_get_tablet_breakpoint()); // Mobile styles (max-width: mobile breakpoint) $mobile = array( '.my-element' => array('font-size' => '14px'), ); $css .= astra_parse_css($mobile, '', astra_get_mobile_breakpoint()); return $css; }); ``` -------------------------------- ### Post Meta Options API Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Functions for retrieving per-post/page settings that override global theme options. ```APIDOC ## Post Meta Options ### Description Retrieves per-post/page settings that override global theme options, enabling granular control over individual content items. ### Method `astra_get_option_meta( string $option_slug, mixed $default = null, bool $only_meta = false, string $meta_key = '', int|WP_Post $post_id = null ): mixed ### Parameters #### Function Parameters - **option_slug** (string) - The unique identifier for the meta option. - **default** (mixed) - The default value to return if the meta option is not found. Defaults to null. - **only_meta** (bool) - If true, only retrieves meta values and does not fall back to global options. Defaults to false. - **meta_key** (string) - The meta key to use when `only_meta` is true. Defaults to ''. - **post_id** (int|WP_Post) - The ID of the post or WP_Post object to retrieve meta from. If null, the current post is used. Defaults to null. ### Request Example ```php // Get post-specific content layout (falls back to global option) $content_layout = astra_get_option_meta('ast-site-content-layout', 'default'); // Get sidebar layout for current post $sidebar = astra_get_option_meta('site-sidebar-layout', 'default'); // Only get meta value (don't fall back to global) $only_meta = astra_get_option_meta('site-sidebar-layout', '', true); if (false === $only_meta) { // No post-specific setting exists } // Get meta from specific post ID $post_id = 123; $layout = astra_get_option_meta('ast-site-content-layout', 'default', false, '', $post_id); // Use in theme templates if (is_singular()) { $container_layout = astra_get_option_meta('ast-site-content-layout'); if ('default' === $container_layout || empty($container_layout)) { $container_layout = astra_get_option('ast-site-content-layout'); } } ``` ### Response #### Success Response (200) - **mixed** - The value of the requested post meta option or the fallback global option. ``` -------------------------------- ### Customize Astra Footer with Hooks Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Utilize 'astra_footer_before', 'astra_footer_content', and 'astra_body_bottom' actions to add elements before the footer, within the main footer area, or just before the closing body tag, suitable for scripts. ```php Subscribe to our newsletter'; }); add_action('astra_footer_content', function() { // Main footer content area }); add_action('astra_body_bottom', function() { // Before closing tag - good for scripts echo ''; }); ``` -------------------------------- ### Update Theme Options API Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Functions for managing theme settings programmatically. Includes before/after action hooks for extensibility. ```APIDOC ## Update Theme Options ### Description Manages theme settings programmatically using `astra_update_option()` and `astra_delete_option()`. Includes before/after action hooks for extensibility. ### Method `astra_update_option( string $option_slug, mixed $value ): bool `astra_delete_option( string $option_slug ): bool ### Parameters #### `astra_update_option` Parameters - **option_slug** (string) - The unique identifier for the theme option to update. - **value** (mixed) - The new value to set for the theme option. #### `astra_delete_option` Parameters - **option_slug** (string) - The unique identifier for the theme option to delete. ### Request Example ```php // Update a theme option astra_update_option('site-content-width', 1400); // Update button colors astra_update_option('button-bg-color', '#0073aa'); astra_update_option('button-bg-h-color', '#005177'); // Delete a theme option (resets to default) astra_delete_option('custom-css'); // Hook into option updates add_action('astra_before_update_option_site-layout', function($value, $option) { // Log layout changes error_log("Layout changing to: {$value}"); }, 10, 2); add_action('astra_after_update_option_site-layout', function($value, $option) { // Clear any cached CSS delete_transient('astra_dynamic_css'); }, 10, 2); ``` ### Response #### Success Response (200) - **bool** - True on success, false on failure. ``` -------------------------------- ### CSS Value Helpers Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Helper functions to format CSS values, including units, font properties, and responsive spacing. ```APIDOC ## CSS Value Helpers ### Description The `astra_get_css_value()` and `astra_get_font_css_value()` functions format CSS values with proper units and handle special cases like fonts and URLs. The `astra_responsive_spacing()` function helps generate responsive spacing values. ### Functions #### `astra_get_css_value( $value, $unit = '' ) ##### Parameters - **value** (mixed) - Required - The CSS value. - **unit** (string) - Optional - The CSS unit (e.g., 'px', 'em', 'url', 'font'). ##### Returns - (string) - Formatted CSS value with unit. ##### Examples ```php // Basic CSS value with unit $width = astra_get_css_value(1200, 'px'); // "1200px" $margin = astra_get_css_value(2, 'em'); // "2em" $opacity = astra_get_css_value(0.8, ''); // "0.8" // URL value formatting $bg_image = astra_get_css_value('image.jpg', 'url'); // "url(image.jpg)" // Font family with fallbacks $font = astra_get_css_value('Roboto', 'font'); // Returns: "Roboto" with system fallbacks if configured ``` #### `astra_get_font_css_value( $value, $unit = 'px', $device = 'desktop' ) ##### Parameters - **value** (int|float) - Required - The font size value. - **unit** (string) - Optional - The unit for the font size (e.g., 'px', 'rem'). Defaults to 'px'. - **device** (string) - Optional - The device breakpoint ('desktop', 'tablet', 'mobile'). Defaults to 'desktop'. ##### Returns - (string) - Formatted font size CSS, potentially including rem conversion. ##### Example ```php // Responsive font size with px to rem conversion $font_size = astra_get_font_css_value(18, 'px', 'desktop'); // Returns: "18px;font-size:1.2rem" (auto-converts to rem based on body font) ``` #### `astra_responsive_spacing( $spacing_array, $position, $device = 'desktop' ) ##### Parameters - **spacing_array** (array) - Required - An array containing spacing values for different devices. - **position** (string) - Required - The specific spacing position (e.g., 'top', 'right', 'bottom', 'left'). - **device** (string) - Optional - The device breakpoint ('desktop', 'tablet', 'mobile'). Defaults to 'desktop'. ##### Returns - (string) - Formatted spacing value with unit. ##### Example ```php // Responsive spacing helper $spacing = astra_responsive_spacing( array( 'desktop' => array('top' => 20, 'right' => 30, 'bottom' => 20, 'left' => 30), 'tablet' => array('top' => 15, 'right' => 20, 'bottom' => 15, 'left' => 20), 'mobile' => array('top' => 10, 'right' => 15, 'bottom' => 10, 'left' => 15), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ), 'top', 'desktop' ); // Returns: "20px" ``` ``` -------------------------------- ### Generate Dynamic CSS with Astra Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Converts PHP arrays into CSS strings, supporting media queries for responsive design. ```php array( 'background-color' => '#ffffff', 'padding' => '20px', 'border-bottom' => '1px solid #eee', ), '.site-title' => array( 'font-size' => '24px', 'font-weight' => '700', 'color' => '#333333', ), ); $css = astra_parse_css($css_output); // Output: .site-header{background-color:#ffffff;padding:20px;border-bottom:1px solid #eee;}.site-title{font-size:24px;font-weight:700;color:#333333;} // Responsive CSS with media queries $tablet_css = array( '.site-header' => array( 'padding' => '15px', ), '.site-title' => array( 'font-size' => '20px', ), ); // Min-width media query (tablet and up) $css .= astra_parse_css($tablet_css, astra_get_tablet_breakpoint()); // Max-width media query (mobile only) $mobile_css = array( '.site-header' => array( 'padding' => '10px', ), ); $css .= astra_parse_css($mobile_css, '', astra_get_mobile_breakpoint()); // Between breakpoints $css .= astra_parse_css($tablet_css, astra_get_mobile_breakpoint(), astra_get_tablet_breakpoint()); ``` -------------------------------- ### Theme Options API Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Functions for retrieving theme settings from the WordPress database. Supports default values and filtering for customization. ```APIDOC ## Theme Options API ### Description Retrieves theme settings from the WordPress database. Supports default values and is filterable for customization. ### Method `astra_get_option( string $option_slug, mixed $default = null, bool $only_meta = false, string $meta_key = '', int|WP_Post $post_id = null ): mixed ### Parameters #### Function Parameters - **option_slug** (string) - The unique identifier for the theme option. - **default** (mixed) - The default value to return if the option is not found. Defaults to null. - **only_meta** (bool) - If true, only retrieves meta values and does not fall back to global options. Defaults to false. - **meta_key** (string) - The meta key to use when `only_meta` is true. Defaults to ''. - **post_id** (int|WP_Post) - The ID of the post or WP_Post object to retrieve meta from. If null, the current post is used. Defaults to null. ### Request Example ```php // Get a single theme option with default fallback $site_layout = astra_get_option('site-layout', 'ast-full-width-layout'); // Get typography settings (returns array for responsive values) $body_font_size = astra_get_option('font-size-body', array( 'desktop' => 16, 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', )); // Get color settings using CSS variables $text_color = astra_get_option('text-color', 'var(--ast-global-color-3)'); $link_color = astra_get_option('link-color', 'var(--ast-global-color-0)'); $theme_color = astra_get_option('theme-color', 'var(--ast-global-color-0)'); // Get container layout settings $content_width = astra_get_option('site-content-width', 1200); $sidebar_width = astra_get_option('site-sidebar-width', 30); // Filter option values dynamically add_filter('astra_get_option_site-layout', function($value, $option, $default) { if (is_page_template('full-width.php')) { return 'ast-full-width-layout'; } return $value; }, 10, 3); ``` ### Response #### Success Response (200) - **mixed** - The value of the requested theme option or meta value. ``` -------------------------------- ### Manage Astra SVG Icons Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Use these methods to check for SVG support, retrieve specific icons, configure icon selectors, and filter icon output. ```php 'default', // 'default', 'custom', or 'none' 'value' => 'search', ); $icon_html = astra_icon_selector_svg($icon_config, false, 'search'); // Echo icon directly astra_icon_selector_svg($icon_config, true, 'search'); } // Get all available logo SVG icons $all_icons = astra_get_logo_svg_icons_array(); // Returns array of icon definitions with SVG paths // Allowed SVG attributes for wp_kses $allowed_svg = Astra_Icons::allowed_svg_args(); // Filter icon output add_filter('astra_search_icon', function($icon) { return '...'; }); ``` -------------------------------- ### Register Customizer Settings in Astra Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Extend the WordPress Customizer by registering new sections, settings, and controls using the 'customize_register' action and Astra's configuration filters. This allows for custom options to be managed within the theme's Customizer interface. ```php add_section('my_custom_section', array( 'title' => __('My Custom Options', 'theme-textdomain'), 'priority' => 50, )); // Add setting $wp_customize->add_setting('my_custom_color', array( 'default' => '#336699', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); // Add control $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'my_custom_color', array( 'label' => __('Custom Color', 'theme-textdomain'), 'section' => 'my_custom_section', ))); }, 20); // Use Astra's option system add_filter('astra_theme_defaults', function($defaults) { $defaults['my-custom-option'] = 'default-value'; $defaults['my-custom-toggle'] = true; return $defaults; }); // Add to Astra customizer configurations add_filter('astra_customizer_configurations', function($configurations) { $configurations[] = array( 'name' => 'my-custom-option', 'type' => 'control', 'control' => 'text', 'section' => 'section-colors', 'title' => __('My Custom Option', 'theme-textdomain'), 'default' => astra_get_option('my-custom-option'), 'priority' => 100, ); return $configurations; }); ``` -------------------------------- ### Dynamic CSS Generation Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt The `astra_parse_css()` function converts PHP arrays into CSS strings, supporting media queries for responsive design. ```APIDOC ## Dynamic CSS Generation ### Description The `astra_parse_css()` function converts PHP arrays into valid CSS strings with optional media query support for responsive designs. ### Method `astra_parse_css( $css_array, $media_query = '', $media_query_end = '' ) ### Parameters #### Request Body - **css_array** (array) - Required - An associative array where keys are CSS selectors and values are arrays of CSS properties and values. - **media_query** (string) - Optional - The starting media query (e.g., `@media (min-width: 768px)`). - **media_query_end** (string) - Optional - The ending media query (e.g., `@media (max-width: 767px)`). ### Request Example ```php // Basic CSS generation $css_output = array( '.site-header' => array( 'background-color' => '#ffffff', 'padding' => '20px', 'border-bottom' => '1px solid #eee', ), '.site-title' => array( 'font-size' => '24px', 'font-weight' => '700', 'color' => '#333333', ), ); $css = astra_parse_css($css_output); ``` ### Response #### Success Response (string) - **css** (string) - The generated CSS string. #### Response Example ```css .site-header{background-color:#ffffff;padding:20px;border-bottom:1px solid #eee;}.site-title{font-size:24px;font-weight:700;color:#333333;} ``` ### Responsive CSS Example ```php // Responsive CSS with media queries $tablet_css = array( '.site-header' => array( 'padding' => '15px', ), '.site-title' => array( 'font-size' => '20px', ), ); // Min-width media query (tablet and up) $css .= astra_parse_css($tablet_css, astra_get_tablet_breakpoint()); // Max-width media query (mobile only) $mobile_css = array( '.site-header' => array( 'padding' => '10px', ), ); $css .= astra_parse_css($mobile_css, '', astra_get_mobile_breakpoint()); // Between breakpoints $css .= astra_parse_css($tablet_css, astra_get_mobile_breakpoint(), astra_get_tablet_breakpoint()); ``` ``` -------------------------------- ### Manage Post Titles and Archive Headers Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Functions for rendering or retrieving post titles and customizing archive page headers. Use filters to conditionally modify output based on post type or template. ```php ', ''); // Get post title without displaying $title = astra_the_post_title('

', '

', 0, false); // Get raw title value $title = astra_get_the_title(); $title = astra_get_the_title(123); // Specific post ID // Filter title output add_filter('astra_the_title_enabled', function($enabled) { // Disable title on specific template if (is_page_template('no-title.php')) { return false; } return $enabled; }); add_filter('astra_the_title', function($title, $post_id) { // Modify title for products if (get_post_type($post_id) === 'product') { return '🛍️ ' . $title; } return $title; }, 10, 2); // Search page title astra_the_search_page_title('

', '

', true); // Archive page header add_action('astra_archive_header', function() { if (is_category()) { echo '
'; the_archive_description(); echo '
'; } }); // Get current post ID helper $post_id = astra_get_post_id(); // Get current post type $post_type = astra_get_post_type(); ``` -------------------------------- ### Retrieve Post Meta with astra_get_option_meta Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Access per-post or per-page settings that override global theme options, with support for specific post IDs and fallback logic. ```php Free shipping on orders over $50!'; }); add_action('astra_masthead_top', function() { // Content inside header, at the top }); add_action('astra_header_after', function() { if (is_front_page()) { echo '
Welcome to our site
'; } }); ``` -------------------------------- ### Filter Astra Responsive Breakpoints Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Globally change the default tablet and mobile breakpoints by filtering 'astra_tablet_breakpoint' and 'astra_mobile_breakpoint'. This affects how responsive styles are applied across the theme. ```php array( 'background-color' => $primary_color, 'color' => astra_get_foreground_color($primary_color), 'padding' => '12px 24px', 'border-radius' => '4px', 'transition' => 'all 0.3s ease', ), '.custom-button:hover' => array( 'background-color' => astra_adjust_brightness($primary_color, 20, 'darken'), ), '.page-header h1' => array( 'color' => $heading_color, ), ); $css .= astra_parse_css($custom_css); // Tablet styles $tablet_css = array( '.custom-button' => array( 'padding' => '10px 20px', ), ); $css .= astra_parse_css($tablet_css, '', astra_get_tablet_breakpoint()); // Mobile styles $mobile_css = array( '.custom-button' => array( 'padding' => '8px 16px', 'font-size' => '14px', 'width' => '100%', ), ); $css .= astra_parse_css($mobile_css, '', astra_get_mobile_breakpoint()); return $css; }, 10, 2); ``` -------------------------------- ### Enable Submenu Below Header Fix Source: https://github.com/projectestac/wordpress-theme-astra/blob/master/changelog.txt Enable the fix for submenus opening below the header. This change is disabled by default for existing sites and can be enabled by adding this filter to your child theme's functions.php file. ```php add_filter( 'astra_submenu_below_header_fix', '__return_true' ); ``` -------------------------------- ### Filter Astra Sidebar Layout Source: https://context7.com/projectestac/wordpress-theme-astra/llms.txt Control sidebar placement by filtering 'astra_page_layout'. This function enables setting specific sidebar layouts like 'no-sidebar' or 'right-sidebar' based on page templates or shop pages. ```php '; echo json_encode(array( '@context' => 'https://schema.org', '@type' => 'Article', 'headline' => get_the_title(), 'author' => array( '@type' => 'Person', 'name' => get_the_author(), ), 'datePublished' => get_the_date('c'), 'dateModified' => get_the_modified_date('c'), )); echo ''; } }); // Breadcrumb schema is handled automatically // Customize breadcrumb output add_filter('astra_breadcrumb_trail_args', function($args) { $args['separator'] = ' > '; $args['show_on_front'] = false; return $args; }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.