Adding a utility or announcement bar above the Avada theme header. I shall display this bar on entire site pages except sales page. So I added following PHP snippet in the functions.php file of Avada child theme.
1 2 3 4 5 6 7 8 9 |
<?php //* Do not add this line add_action( 'avada_before_body_content', 'cp_utility_bar' ); function cp_utility_bar() { if( is_page( 123 ) ) // 123 is my sales page ID return; echo '<div class="utility-bar"><a href="ENTER PAGE LINK" target="_self">ENTER YOUR ANNOUNCEMENT HERE.</a></div>' . "\n"; } |
If you look the header.php file of Avada theme, you will get this hook avada_before_body_content. I targeted… Continue Reading