I have a site where I added a text link near our logo using a widget and the following functions code:
add_action( ‘ava_main_header’, ‘enfold_customization_header_widget_area’ );
function enfold_customization_header_widget_area() {
dynamic_sidebar( ‘header’ );
}
Works just fine.
Now I am trying to implement this in the top right of the secondary menu:
[maxbutton id=”1″] 212-813-2146 [maxbutton id=”2″]
and need to add this to the functions code to get it to work:
add_action( ‘avia_meta_header’, ‘enfold_customization_header_widget_area’ );
function enfold_customization_header_widget_area() {
dynamic_sidebar( ‘topbar’ );
}
Every time I get an error stating that the variables are already declared. I need this widget in so I can get the buttons rendered.
Hey crtdude,
Please try this instead:
add_action( 'ava_after_main_menu', 'enfold_customization_header_widget_area' );
function enfold_customization_header_widget_area() {
dynamic_sidebar( 'header' );
dynamic_sidebar( 'topbar' );
}
Best regards,
Rikard
Rikard, you have ava_after_main_menu in your solution. I want the widget “topbar” in the secondary menu bar above everything else. It works with avia_meta_header. The widget will take the place of the secondary which normally appears at the top right.
Hi,
Ok, thanks for the feedback, I wasn’t entirely sure what you were trying to do. The error message is likely due to having the same name for your functions:
function enfold_customization_header_widget_area
Could you try giving one of your functions a different name maybe?
Best regards,
Rikard