Astra Header & Footer Filters – Astra https://wpastra.com Fast, Lightweight & Customizable WordPress Theme for Any Website Wed, 23 Feb 2022 20:29:53 +0000 en-US hourly 1 https://wordpress.org/?v=5.9.3 https://wpastra.com/wp-content/uploads/2020/01/favicon-astra2x.png Astra Header & Footer Filters – Astra https://wpastra.com 32 32 Replace Deprecated Astra Theme and Astra Pro Hooks https://wpastra.com/docs/deprecated-astra-hooks/ https://wpastra.com/docs/deprecated-astra-hooks/#respond Fri, 08 Oct 2021 11:58:24 +0000 https://wpastra.com/?post_type=docs&p=104951 Replace Deprecated Astra Theme and Astra Pro Hooks Read More »

]]>
Following Astra Theme 3.7.4 and Astra Pro 3.6.2 updates, we deprecated a significant number of functions, filters, and actions. Thus, some of the Astra hooks you might have added to your website should be updated.

Therefore, this document will help you replace these hooks on your website. Please use the lists below to update your code.

Deprecated Astra Hooks and Their Replacements

In short, further down, you will find lists of functions, filters, and actions. Accordingly, please update hooks if you added any filters, actions, or other functions to your website.

Astra Theme 3.7.4 and Astra Pro 3.6.2 versions are still compatible with old codes to avoid any issues. Although your website will still work well after the update, you should replace deprecated hooks with the replacements below.

Further, to help you with these updates, we added backend notifications:

Deprecated Astra Hooks Norification

Hence, you can do this by replacing deprecated hooks in your code with the replacements from the lists. This way, your website will remain fully functional and compatible with future updates.

Deprecated actionReplacement
astra_get_css_filesastra_addon_get_css_files
astra_get_css_filesastra_addon_get_js_files
astra_after_render_jsastra_addon_after_render_js
asta_register_admin_menu astra_register_admin_menu
Deprecated filterReplacement
astra_bb_render_content_by_idastra_addon_bb_render_content_by_id
astra_get_assets_uploads_dirastra_addon_get_assets_uploads_dir
astra_pro_show_brandingastra_addon_show_branding
astra_dynamic_cssastra_addon_dynamic_css
astra_add_css_fileastra_addon_add_css_file
astra_add_js_fileastra_addon_add_js_file
astra_add_dependent_js_fileastra_addon_add_dependent_js_file
astra_render_cssastra_addon_render_css
astra_render_jsastra_addon_render_js
astra_languages_directoryastra_addon_languages_directory
astra_ext_default_addonsastra_addon_ext_default_addons
astra_get_addonsastra_addon_get_addons
astra_ext_enabled_extensionsastra_addon_enabled_extensions
astra_custom_404_optionsastra_addon_custom_404_options
astra_cache_asset_query_varastra_addon_cache_asset_query_var
astra_cache_asset_typeastra_addon_cache_asset_type
astra_load_dynamic_css_inlineastra_addon_load_dynamic_css_inline
astra_flags_svgastra_addon_flags_svg
astra_display_on_listastra_addon_display_on_list
astra_location_rule_post_typesastra_addon_location_rule_post_types
astra_user_roles_listastra_addon_user_roles_list
astra_target_page_settingsastra_addon_target_page_settings
astra_get_display_posts_by_conditionsastra_addon_get_display_posts_by_conditions
astra_meta_args_post_by_conditionastra_addon_meta_args_post_by_condition
astra_pro_white_label_add_formastra_addon_white_label_add_form
ast_footer_bar_displayastra_footer_bar_display
ast_main_header_displayastra_main_header_display
secondary_submenu_border_classastra_secondary_submenu_border_class
gtn_image_group_css_compastra_gutenberg_image_group_style_support
ast_footer_sml_layoutastra_footer_sml_layout
primary_submenu_border_classastra_primary_submenu_border_class
Deprecated functionReplacement
astra_get_supported_posts                                      astra_addon_get_supported_posts
astra_rgba2hexastra_addon_rgba2hex
astra_check_is_hexastra_addon_check_is_hex
is_support_swap_mobile_below_header_sectionsastra_addon_swap_mobile_below_header_sections
is_astra_theme_3_5_0_versionastra_addon_check_theme_3_5_0_version
sticky_header_default_site_title_tagline_css_compastra_addon_sticky_site_title_tagline_css_comp
is_support_swap_mobile_above_header_sectionsastra_addon_support_swap_mobile_above_header_sections
astra_return_content_layout_page_builderastra_addon_return_content_layout_page_builder
astra_return_page_layout_no_sidebarastra_addon_return_page_layout_no_sidebar
astra_pro_is_emp_endpointastra_addon_is_amp_endpoint
is_astra_breadcrumb_trailastra_addon_is_breadcrumb_trail
astra_breadcrumb_shortcodeastra_addon_breadcrumb_shortcode
astra_get_templateastra_addon_get_template
astra_locate_templateastra_addon_locate_template
astra_ext_adv_search_dynamic_cssastra_addon_adv_search_dynamic_css
astra_ext_advanced_search_dynamic_cssastra_addon_advanced_search_dynamic_css
astra_ext_header_builder_sections_colors_dynamic_cssastra_addon_header_builder_sections_colors_dynamic_css
astra_ext_header_sections_colors_dynamic_cssastra_addon_header_sections_colors_dynamic_css
astra_ldrv3_dynamic_cssastra_addon_ldrv3_dynamic_css
astra_learndash_dynamic_cssastra_addon_learndash_dynamic_css
astra_ext_mobile_above_header_dynamic_cssastra_addon_mobile_above_header_dynamic_css
astra_ext_mobile_below_header_dynamic_cssastra_addon_mobile_below_header_dynamic_css
astra_ext_mobile_header_colors_background_dynamic_cssastra_addon_mobile_header_colors_background_dynamic_css
astra_ext_mobile_header_spacing_dynamic_cssastra_addon_mobile_header_spacing_dynamic_css
astra_ext_mobile_header_dynamic_cssastra_addon_mobile_header_dynamic_css
astra_ext_mega_menu_dynamic_cssastra_addon_mega_menu_dynamic_css
astra_ext_scroll_to_top_dynamic_cssastra_addon_scroll_to_top_dynamic_css
astra_ext_fb_button_dynamic_cssastra_addon_footer_button_dynamic_css
astra_fb_divider_dynamic_cssastra_addon_footer_divider_dynamic_css
astra_fb_lang_switcher_dynamic_cssastra_addon_footer_lang_switcher_dynamic_css
astra_footer_social_dynamic_cssastra_addon_footer_social_dynamic_css
astra_ext_hb_button_dynamic_cssastra_addon_header_button_dynamic_css
astra_hb_divider_dynamic_cssastra_addon_header_divider_dynamic_css
astra_hb_lang_switcher_dynamic_cssastra_addon_header_lang_switcher_dynamic_css
astra_ext_hb_menu_dynamic_cssastra_addon_header_menu_dynamic_css
astra_header_social_dynamic_cssastra_addon_header_social_dynamic_css
]]>
https://wpastra.com/docs/deprecated-astra-hooks/feed/ 0
How To Remove the Astra Header From Entire Site? https://wpastra.com/docs/remove-astra-header-from-entire-site/ https://wpastra.com/docs/remove-astra-header-from-entire-site/#respond Sun, 05 Sep 2021 13:43:39 +0000 https://wpastra.com/?post_type=docs&p=103209 How To Remove the Astra Header From Entire Site? Read More »

]]>
Using the Astra Meta Settings, you can easily disable the Header for each page or post separately. On the other side, if you want to remove the Astra Header from your entire website, this could be a tedious and time-consuming task.

To completely remove the Astra Header in a quick and easy way, you can use a custom code (filter). You would need to add the following filter to the functions.php file of your Child Theme:

add_action( 'wp', 'remove_astra_header_callback');
function remove_astra_header_callback(){
remove_action( 'astra_header', 'astra_header_markup' );
}

If you don’t have your Child Theme installed, please check this article on how to do it. If you are not sure how to add this code, please check this article.

]]>
https://wpastra.com/docs/remove-astra-header-from-entire-site/feed/ 0
How To Enable Design Options for Header and Footer Widgets in Block-Based Editor https://wpastra.com/docs/enable-astra-widget-design-options/ https://wpastra.com/docs/enable-astra-widget-design-options/#respond Mon, 09 Aug 2021 14:24:39 +0000 https://wpastra.com/?post_type=docs&p=101630 How To Enable Design Options for Header and Footer Widgets in Block-Based Editor Read More »

]]>
One of the many changes brought about by WordPress 5.8 is Block-Based Widgets Editor. This feature allowed using blocks in your widget areas, next to the older legacy widgets used before. Astra Theme provides support for this feature, including the Header and Footer Builder Widgets too. 

Block-Based Widgets Editor

On the other hand, if you would like to continue using Astra’s widget design options for your Header and Footer widgets as before, you can do this by adding a code. This would allow you to keep using the theme widget design settings (font, color), together with the Block-Based Widgets Editor.

If on the other side you would like to completely remove the Block Editor support for Widgets, please check this article.

What Changed And Why Would I Need This?

The Astra theme provides a lot of freedom when building your websites. Header and Footer Widgets come with a number of different color and font settings making customization easy. 

Astra Widget Design Options

With the introduction of Block-Based Widgets Editor, you can add Blocks directly to your Astra Header and Footer using the Widget Element. Since there are many Blocks, each with its own settings, we removed the Astra widget design options to fully support this WordPress feature.

Widget Editor - Block Settings

Instead, you can customize each Block independently using its block editor settings. If you still wish to use Astra options for Header and Footer Widgets, you can do this by adding a filter. This will enable you to use Astra widget design options as before, while still fully benefiting from the improvements brought by Block-Based Widgets Editor.

You will find the needed Astra widget design options under the “Design” button of widget elements you add to your Header or Footer Builder.

Astra Widget Design Button

How Can I Do This?

If you would like to enable Astra’s widget font and color options in Block-Based Widget Editor, you need to add a custom code. Please keep in mind that these design settings may not work for some widget blocks, as these options are deprecated. 

You can add the following custom code to the functions.php file of your Child Theme:

add_filter( 'astra_remove_widget_design_options', '__return_false' );

If you don’t have your Child Theme installed, please check this article on how to do it. 
If you are not sure how to add this code, please check this article.

]]>
https://wpastra.com/docs/enable-astra-widget-design-options/feed/ 0
How to Change the Heading Tag for the Related Posts Title? https://wpastra.com/docs/change-tag-for-related-posts-title/ Fri, 25 Jun 2021 10:49:04 +0000 https://wpastra.com/?post_type=docs&p=94496 How to Change the Heading Tag for the Related Posts Title? Read More »

]]>
If you have enabled related posts on your Blog posts, you might have noticed that the Related Posts Title has the <h2> heading tag assigned by default.

You can modify this tag to any other HTML tag by adding a filter to the functions.php file of your Astra Child Theme. If you don’t have a Child Theme installed and activated on your website, please check this article on how to do this

How Can I Do This?

You can use the filter below to change the tag for the Related Posts Title to any other tag. Please follow these steps:

Step 1 – Navigate to Dashboard > Appearance > Theme Editor and select the Child Theme;

Step 2 – Add the filter below to the functions.php file of your Child Theme. You can check this article on adding code to your Child Theme to help you out;

// Filter for changing related posts title heading tag.
add_filter( 'astra_related_posts_title', 'update_related_posts_title_markup', 10, 1 );
function update_related_posts_title_markup( $markup ) {
    $markup = '<div class="ast-related-posts-title-section">';
     $markup .= '<h4 class="ast-related-posts-title">'; // Replace H4 with the tag you need.
 $markup .= 'Related Posts';
 $markup .= '</h4>'; // Replace H4 with the tag you need.
    $markup .= '</div>';
    return $markup;
}

Step 3 – The filter will change the default <h2> tag to <h4> tag. Update this by replacing <h4> in the code with any heading tag needed. Click the “Update File” button to apply changes.

Note:

Please keep in mind that you need to replace the h4 tag with your needed tag in both places within the code to make this work – one is the opening tag, and the other one is the closing tag (just like we have used <h4> in both places in the code above).

Default Tag

Astra Theme - Related Posts Title Default Tag, Astra 3.0+

Heading Tag after adding the Filter

Astra Theme - Related Posts Title Tag with Added Filter, Astra 3.0+
]]>
Change Footer Widget Title’s Heading Tag https://wpastra.com/docs/change-footer-widget-title-heading-tag/ Mon, 27 Jul 2020 08:58:54 +0000 https://wpastra.com/?post_type=docs&p=63094 Change Footer Widget Title’s Heading Tag Read More »

]]>
When you add a widget in the footer, a default heading tag that will be applied to widget title is H2

Astra Footer Default Heading Tag New

If you wish to change this heading tag use the following custom code. Add the respective filter code in the child theme’s functions.php file. 

// Footer Widget 1
add_filter( 'astra_advanced_footer_widget_1_args', 'widget_title_footer_1_tag', 10, 1 );

function widget_title_footer_1_tag( $atts ) {
    $atts['before_title'] = '<h1 class="widget-title">';
    $atts['after_title'] = '</h1>';
    return $atts;
}

// Footer Widget 2
add_filter( 'astra_advanced_footer_widget_2_args', 'widget_title_footer_2_tag', 10, 1 );

function widget_title_footer_2_tag( $atts ) {
    $atts['before_title'] = '<h3 class="widget-title">';
    $atts['after_title'] = '</h3>';
    return $atts;
}

// Footer Widget 3
add_filter( 'astra_advanced_footer_widget_3_args', 'widget_title_footer_3_tag', 10, 1 );

function widget_title_footer_3_tag( $atts ) {
    $atts['before_title'] = '<h4 class="widget-title">';
    $atts['after_title'] = '</h4>';
    return $atts;
}

// Footer Widget 4
add_filter( 'astra_advanced_footer_widget_4_args', 'widget_title_footer_4_tag', 10, 1 );

function widget_title_footer_4_tag( $atts ) {
    $atts['before_title'] = '<p class="widget-title">';
    $atts['after_title'] = '</p>';
    return $atts;
}

// Footer Widget 5
add_filter( 'astra_advanced_footer_widget_5_args', 'widget_title_footer_5_tag', 10, 1 );

function widget_title_footer_5_tag( $atts ) {
    $atts['before_title'] = '<div class="widget-title">';
    $atts['after_title'] = '</div>';
    return $atts;
}

You can choose from the required filter for the respective widget and update the tag as per your requirement.

For e.g. You are looking to update the Third Footer widget title for that you will need to copy the code just as below and paste it in your child theme’s functions.php.

add_filter( 'astra_advanced_footer_widget_3_args', 'widget_title_footer_3_tag', 10, 1 );

function widget_title_footer_3_tag( $atts ) {
    $atts['before_title'] = '<h4 class="widget-title">';
    $atts['after_title'] = '</h4>';
    return $atts;
}

Note:

If you have built the Footer using the Footer builder of Header Footer builder, please use the below code –

add_filter( 'astra_footer_widget_1args', 'widget_title_footer_1_tag', 10, 1 );


function widget_title_footer_1_tag( $atts ) {
    $atts['before_title'] = '<h1 class="widget-title">';
    $atts['after_title'] = '</h1>';
    return $atts;
}

Note:

Please note, that you pick the correct filter having the number and update the heading tags h4 or other as required.

Refer this doc on How to Add Custom PHP Code?

]]>
How to Update Responsive Breakpoints for Tablet+Mobile in Astra? https://wpastra.com/docs/set-update-breakpoints-tablet-mobile-in-astra/ Mon, 13 Apr 2020 11:14:44 +0000 https://wpastra.com/?post_type=docs&p=57907 How to Update Responsive Breakpoints for Tablet+Mobile in Astra? Read More »

]]>
Previously in Astra, we had default breakpoints i.e. 544 for Mobile and 768 for Tablet devices. In the Astra v2.4.0, we are providing the feature to set the Responsive breakpoint in Astra and match them with your page builder.

Default breakpoints –

  • Mobile Breakpoints – Existing and New – 544px both are the same.
  • Tablet Breakpoints – 768 ( Existing ) – 921 ( New Breakpoint )

Why?

  • Some users had a requirement for different breakpoints. Let’s suppose you’re building your website with a page builder and the page builder has different breakpoints ( rather than 544 & 768 ).
  • When a Menu is created with a breakpoint at 921px, below which our menu turns into a Hamburger Menu so normally the colors for this device should render as Tablet, but in this case, the colors are inheriting from the desktop. Because prior to this version we had a default breakpoint of 768px for tablet. This scenario has been taken care of in this release.

So starting from the Astra v2.4.0 update you can alter Astra theme’s Tablet & Mobile breakpoints with respect to the page builder’s breakpoints.

Solution!

In our Astra v2.4.0, we have introduced new breakpoints for new users they are, for Tablet = 921px, for Mobile = 544px.

What it means for the existing users, the site or any changes won’t be affected, their breakpoints will be 768px & 544px as it worked.

If the existing users want to update their default breakpoints with some different breakpoints, they can use the following filter –

We have introduced two new filters to change the Mobile and Tablet breakpoint numbers.

To change the Mobile Breakpoint:

// Update your custom mobile breakpoint below - like return 544;
add_filter( 'astra_mobile_breakpoint', function() {
    return 544;
});

To change the Tablet Breakpoint:

// Update your custom tablet breakpoint below - like return 921;
add_filter( 'astra_tablet_breakpoint', function() {
    return 921;
});

Note: Follow the steps here in this document to add the above filter or any custom code using the Child Theme or other methods as mentioned.

For existing users, we recommend to please use the same breakpoint value for “astra_tablet_breakpoint” and from the Primary Menu > Menu breakpoint. So when your menu displays a Hamburger Menu it will load the tablet settings for both ( i.e. customizer settings & CSS styling ).


Are you facing style issues on RTL ready website?
=> We would recommend visiting the Astra Options page and refresh the page to resolve style issue. Or if the CSS File Generation is enabled try refreshing the setting.

Recommended: To have the latest version of both the Astra theme and Astra Pro Addon i.e. 2.4.0 and above.

]]>
Change Placeholder for Search Box (Old Astra Header) https://wpastra.com/docs/change-search-placeholder/ Wed, 06 Nov 2019 10:24:17 +0000 https://wpastra.com/?post_type=docs&p=47305 Change Placeholder for Search Box (Old Astra Header) Read More »

]]>
Using the Astra Theme with old header options (Header Footer Builder is available since Astra theme version 3.0) and Astra Pro Addon, you can add a search box to your Primary Menu. The placeholder that is used here is “Search” by default.

Astra Search Box Default Placeholder

You can change it to any text by adding a custom code. To do this, please add the following code to your Astra Child theme’s functions.php file:

function astra_get_search_form( $echo = true ) {

    $form = '<form role="search" method="get" class="search-form" action="' . esc_url( home_url( '/' ) ) . '">
        <label>
            <span class="screen-reader-text">' . _x( 'Search for:', 'label', 'astra' ) . '</span>
            <input type="search" class="search-field" ' . apply_filters( 'astra_search_field_toggle_data_attrs', '' ) . ' placeholder="' . esc_attr_x( 'My custom text', 'placeholder', 'astra' ) . '" value="' . get_search_query() . '" name="s" role="search" tabindex="-1"/>
        </label>
        <button type="submit" class="search-submit" value="' . esc_attr__( 'Search', 'astra' ) . '"><i class="astra-search-icon"></i></button>
    </form>';
  
  // Replace My Placeholder with your desired string.

    $result = apply_filters( 'astra_get_search_form', $form );

    if ( null === $result ) {
        $result = $form;
    }

    if ( $echo ) {
        echo $result;
    } else {
        return $result;
    }
}

To set your desired placeholder text, just replace the words My custom text with your text in the following part of the code:

...
<input type="search" class="search-field" ' . apply_filters( 'astra_search_field_toggle_data_attrs', '' ) . ' placeholder="' . esc_attr_x( 'My custom text', 'placeholder', 'astra' ) . '" value="' . get_search_query() . '" name="s" role="search" tabindex="-1"/>
...

In case you are using Astra Search Shortcodes, or you added the search feature to your Above or Below Header, the code will work only with the “Slide” search style.

If you need to change the placeholder with other Search styles, please add one of these codes instead. Add the code based on the style you want to use:

  • for “Full-Screen” Style:
function full_screen_search_placeholder( $strings ) {
    $strings['string-full-width-search-placeholder']   = 'My custom text';
    return $strings;
}
add_filter( 'astra_default_strings', 'full_screen_search_placeholder', 99 );
  • for “Header Cover” Style:
function header_cover_search_placeholder( $strings ) {
    $strings['string-header-cover-search-placeholder']   = 'My custom text';
    return $strings;
}
add_filter( 'astra_default_strings', 'header_cover_search_placeholder', 99 ); 
  • for “Search Box” Style:
function search_box_placebolder( $form ) {
    $form = str_replace( 'placeholder="Search &hellip;"', 'placeholder="My custom text"', $form );
    return $form;
}
add_filter( 'astra_get_search_form', 'search_box_placebolder' ); 

Same as with the first code, to set your desired placeholder text, just replace the words My custom text with your text in the bolded part of the code.

]]>
Change the String “Search Results For” https://wpastra.com/docs/change-search-string/ Wed, 06 Nov 2019 09:47:10 +0000 https://wpastra.com/?post_type=docs&p=47295 When you execute a search within a website using Astra’s search option, you can see a similar layout as below. In case you wish to alter the default string – ” Search Results For “, use the code mentioned below.

Default Search Result String with Astra

Note: Add the following code in the child theme’s functions.php file.

add_filter( 'astra_the_search_page_title', 'my_function', 10 ); 

function my_function() {
    return sprintf( __( 'Add Custom Text Here: %s', 'astra' ), '<span>' . get_search_query() . '</span>' );
}
]]>
How to Change the Heading Tag for the Page/Post Titles? https://wpastra.com/docs/change-heading-tag-for-post-title/ Wed, 07 Aug 2019 07:54:06 +0000 https://wpastra.com/?post_type=docs&p=39392 How to Change the Heading Tag for the Page/Post Titles? Read More »

]]>
A Page/Post title is usually used to let the users know which page they are currently on. You can enable or disable the Page/Post Title for the website in Astra Settings ( Edit Page / Edit Post > Astra Settings > Disable Sections > Disable Title ). By default this Title has heading tag <h1> assigned in HTML structure.

You can modify this tag to any other HTML tag by adding a filter to the functions.php file of your Astra Child Theme. If you don’t have a Child Theme installed and activated on your website, please check this article on how to do this.

How Can I Do This?

If you looking to change the tag of a title (like Page/Post title), you can use the below filter to change the tag for all the titles on your website. Please follow these steps:

Step 1 – Navigate to Dashboard > Appearance > Theme Editor and select the Child Theme

Step 2 – Add the filter below to the functions.php file of your Child Theme. You can check this article on adding code to your Child Theme to help you out.

add_action( 'wp', 'astra_add_title_filter' );

/**
* Function to add filters to change titles.
*
* @return void
*/
function astra_add_title_filter() {
	add_filter( 'astra_the_title_before', 'astra_the_title_before_tag', 1, 10 );
	add_filter( 'astra_the_title_after', 'astra_the_title_after_tag', 1, 10 );
}

/**
* Function to change tag in all titles.
*
* @param string $tag This contains default tag used for the titles.
* @return string
*/
function astra_the_title_before_tag( $tag ) {
	$tag = '<h4>';
	return $tag;
}

/**
* Function to change tag in all titles.
*
* @param string $tag This contains default tag used for the titles.
* @return string
*/
function astra_the_title_after_tag( $tag ) {
	$tag = '</h4>';
	return $tag;
}

Step 3 – The filter will change the default <h1> tag to <h4> tag. Update this by replacing <h4> in the code with any heading tag (or other) needed. Click the “Update File” button to apply changes.

Note:

The following functions, astra_the_title_before_tag, and astra_the_title_after_tag, need to contain the same tag, as one function is for the opening tag, and the other one is for the closing tag (just like we have used <h4> for both in the code above).

Default Tag

Astra Page Post Title on Frontend

Heading Tag after adding the Filter

Astra 2 Page Post Title with Filter
]]>
How to Change HTML tag for Site Title and Tagline? https://wpastra.com/docs/change-site-title-tagline-html-tag/ Tue, 04 Jun 2019 18:30:00 +0000 https://wpastra.com/?post_type=docs&p=37556 How to Change HTML tag for Site Title and Tagline? Read More »

]]>
From Astra customizer settings ( Customize > Header > Site Identity > Site Tagline / Site Title ), you can add the Title or a Tagline for your site. A Site Title is the name of your side, and the tagline is a small catchy descriptive line for your site.

Enable Tagline, Astra 3.0+

By default, the Title has Heading 1 tag <H1> while tagline has paragraph tag <p> in HTML structure. You can change this tag to any other HTML tag using the following filters:

  • Change Tag For a Tagline
add_filter( 'astra_site_tagline_tag', 'astra_change_site_tagline_tag' );

/* Function to change tag of Site Tagline.
@param string $tag Default is p tag.
*/
function astra_change_site_tagline_tag( $tag ) {
$tag = 'h6';
return $tag;
}

Note:

1. Above filter will change tag to tag. You can update it as per your requirement.

2. Paste the above code in the child theme’s functions.php file.

This is how your Default tag looks in your code:

Tagline Default Tag, Astra 3.0+

And this is the change from <p> to <H6> in your code after adding the Filter:

  • Change Tag For a Site Title

You can also replace the H1 tag for the Title with span tag using the below filter –

add_filter( 'astra_site_title_tag', 'astra_function_change_site_title' );

/**
* Function to replace h1 tag with span in site title.
*
* @param string $tag This contains the tag used for site titles.
* @return string
*/
function astra_function_change_site_title( $tag ) {
    $tag = 'span';
    return $tag;
}
Tagline Heading Tag, Astra 3.0+
]]>