Hi Team,
I use this code for show an widget Area after content (before header) for all portfolio items:
function enfold_widget_before_footer_for_single_portfolio() {
if(is_singular(‘post’) || is_singular(‘portfolio’)){
dynamic_sidebar( ‘portfoliocontact’ );
}
}
add_action(‘ava_after_content’, ‘enfold_widget_before_footer_for_single_portfolio’ );
But this don’t work – why?
Thank you
Michael
Hey Mike61,
Your snippet is using the hook ava_after_content, so it will show after the content, if you want the widget to show before the header you will need to use ava_main_header
Like this:
function enfold_widget_before_header_for_single_portfolio() {
if(is_singular('post') || is_singular('portfolio')){
dynamic_sidebar( 'portfoliocontact' );
}
}
add_action('ava_main_header', 'enfold_widget_before_header_for_single_portfolio' );
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
Best regards,
Mike
Hey Mike,
Yes, your code shows the widget before / above the header, sorry, that was my mistake. I need the widget after the content and before the FOOTER!
Best regards
Michael
Hi,
Try this instead
function enfold_widget_before_footer_for_single_portfolio() {
if(is_singular('post') || is_singular('portfolio')){
dynamic_sidebar( 'portfoliocontact' );
}
}
add_action('ava_before_footer', 'enfold_widget_before_footer_for_single_portfolio' );
Best regards,
Mike
Hi Mike,
thank you, this will work!
Best regards
Mike
Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.
Best regards,
Mike