Home › Forums › WoodMart support forum › How to add a snippet to sticky header
How to add a snippet to sticky header
- This topic has 7 replies, 2 voices, and was last updated 5 years, 5 months ago by
Artem Temos.
-
AuthorPosts
-
October 7, 2019 at 6:14 am #148797
gorbunov1989ParticipantHello! I have a interesting question. I need to add one snippet to the sticky header.
A wanna use a “Sticky header clone” but i wanna add somme additional information on this header( phone button)
Trying to use a simple snippeŠµt like
/////////////////////////////////////////////////
function myheadinfo() {
echo ‘ Hello world!’;}
add_action(‘NEED HELP’, ‘myheadinfo’, 62);/////////////////////////////////////////////////
PLZ Help me) Can’t understand when it need add
Attachments:
You must be logged in to view attached files.October 7, 2019 at 8:17 am #148835
Artem TemosKeymasterHello,
To customize the sticky header clone structure you need to add the following snippet to the functions.php file in the child theme and customize it
function woodmart_header_clone_custom_structure($template){ $template = ' <div class="whb-sticky-header whb-clone whb-main-header <%wrapperClasses%>"> <div class="<%cloneClass%>"> <div class="container"> <div class="whb-flex-row whb-general-header-inner"> <div class="whb-column whb-col-left whb-visible-lg"> <%.site-logo%> </div> <div class="whb-column whb-col-center whb-visible-lg"> <%.main-nav%> </div> <div class="whb-column whb-col-right whb-visible-lg"> <%.woodmart-header-links%> <%.search-button:not(.mobile-search-icon)%> <%.woodmart-wishlist-info-widget%> <%.woodmart-compare-info-widget%> <%.woodmart-shopping-cart%> <%.full-screen-burger-icon%> </div> <%.whb-mobile-left%> <%.whb-mobile-center%> <%.whb-mobile-right%> </div> </div> </div> </div> '; return $template; } add_filter( 'woodmart_header_clone_template', 'woodmart_header_clone_custom_structure' );
Regards
October 7, 2019 at 9:13 am #148852
gorbunov1989ParticipantThanks a lot! But how i must to change my snippet to add it after main-nav block
Thanks!October 7, 2019 at 9:34 am #148861
Artem TemosKeymasterYou can put any text after
<%.main-nav%>
code in this case.October 7, 2019 at 9:36 am #148863
gorbunov1989ParticipantHow can i add Shortcode like [html_block id="90"] here?
Sory, i just started to learn PHP…October 7, 2019 at 11:08 am #148879
Artem TemosKeymasterYou can do something like that
<div class="whb-column whb-col-center whb-visible-lg"> <%.main-nav%> ' . do_shortcode( '[html_block id="90"]' ) . ' </div>
October 7, 2019 at 12:00 pm #148892
gorbunov1989ParticipantThanks a lot!! Have a nice day guys!
October 7, 2019 at 12:25 pm #148897
Artem TemosKeymasterYou are welcome!
-
AuthorPosts
Tagged: Snippet to sticky header
The topic ‘How to add a snippet to sticky header’ is closed to new replies.
- You must be logged in to create new topics. Login / Register