WordPress knowledge sharing

How can I add multiple elements in the Astra Header/Footer Generator?

Used Astra Header Footer Generator People will be impressed by the ingenious design and easy to use functions. When there is a need for more header/footer elements, you can also manually add multiple elements.

Friends who don't know how to use Astra header/footer generator, please go to How to use the Astra Theme Header Generator How to use the Astra Footer Generator to create a website footer

The theme of Astra is as low as 30% off, and the Pro version is $47/year, Sign in now Participate in New Year's promotional activities!
For more Astra topics, see Astra topic
For learning and small websites, choose servers with 1 core and 2g configuration to start, and for foreign theme websites, choose 2-core and 4g configuration to run smoothly.
Domestic servers: Alibaba Cloud Tencent Cloud (All have vouchers, which can be used to save money when paying) I don't know how to select regions and configurations. Please add Lao Wei's contact information on the right side of the page. Let's study it together.
Foreign trade website selection for long-term operation Hostinger virtual host , WordPress website speed, stability are great, cost-effective!
About the host: Hoster Topic

1. The following tables are the default elements and functions of the header editor in the Astra theme and Astra Pro plug-in:

Astra Theme Astra Pro
Website identity and logo Site ID and logo+1 extra option
Main Menu Main Menu
Secondary menu Secondary menu
Button 1 Button 2 (up to 10)
HTML 2 HTML 2 (up to 10)
Widget 2 Widget 4 (up to 10)
search Search+1 extra option
Social sharing Social sharing 1 (up to 10)
WooCommerce shopping cart WooCommerce shopping cart+1 extra option
wheelbarrow EDD shopping cart+1 extra option
Off Canvas menu (on phones and tablets) Off Canvas Menu 1+Extra Options (on phones and tablets)
account Account 1+additional options
Divider 3 (up to 10)
Language switcher
Toggle button (for desktop)

2. The following table shows the default elements and functions of the footer editor in the Astra theme and Astra Pro plug-in:

Astra Theme Astra Pro
Footer Menu Footer Menu 1+Extra Options
Social sharing Social sharing 1+up to 10
HTML 1 HTML 2+up to 10
Widget 4 Widgets 6+up to 10
Copyright 1 Copyright 1+Extra options
Buttons 2+up to 10
Divider 3+max. 10
Language switcher [new]

3. Difference between header and footer elements in Astra theme and Astra Pro plug-in

The number of each element of the Astra theme is limited. In Astra Pro, the default number is more. If it is not enough, the number can be expanded.

For example, Astra provides a Button element by default. When the Astra Pro plug-in is activated, two buttons are available.

After the Astra Pro plug-in is enabled, more elements can be expanded if the number of elements is not enough (the upper limit is in the table above). You can extend operations on most elements in the Astra header/footer builder and add multiple elements.

4. How to add multiple elements to Astra header/footer

Purchase, install and activate the Astra Pro plug-in This step is the first to complete.

Install and activate the Astra subtheme , used to add custom code for multiple elements.

Edit the functions.php file of the Astra subtheme, and add the following code at the end.

/**
Update the count of elements in HF Builder.
*
@return array $elements
*/
function astra_builder_elements_count( $elements ) {
$elements[‘header-button’] = 3;
$elements[‘footer-button’] = 3;
$elements[‘header-html’] = 3;
$elements[‘footer-html’] = 3;
$elements[‘header-widget’] = 3;
$elements[‘footer-widget’] = 3;
$elements[‘header-social-icons’] = 3;
$elements[‘footer-social-icons’] = 6;
return $elements;
}
add_filter( ‘astra_builder_elements_count’, ‘astra_builder_elements_count’, 10 );

In the above code, header button=3 means adding three header buttons, and footer social icons=6 means adding six social media icons, which is easy to understand.

For example, footer widget=6 means adding 6 gadgets to the footer, as shown in the following figure:

 Add multiple elements to Astra header/footer
Like( one )
Article name: How to add multiple elements in the Astra Header/Footer Generator
Article link: https://www.vpsss.net/27305.html
Copyright notice: The resources of this website are only for personal learning and exchange, and are not allowed to be reproduced and used for commercial purposes, otherwise, legal issues will be borne by yourself.
The copyright of the pictures belongs to their respective creators, and the picture watermark is for the purpose of preventing unscrupulous people from stealing the fruits of labor.