-
AuthorPosts
-
May 17, 2017 at 10:37 am #794753
Hi,
Here is tutorial about how to create Header as Widget: http://kriesi.at/documentation/enfold/adding-a-widget-area-to-the-header/ with snippets. Thank you a lot – it was very helpfull for me! I created the header and i can see it at the every page of my site.
But how can i create custom header for one specific page on my site and how to add it at this specific page of my site? I will be very thankful if you would help me.
Thanks in advance
Upd: actually i only need to change One or two strings, may be :after could help. But i can’t find out how to get it work. My site adress:
http://bruge-temp.hostenko.com- This topic was modified 7 years, 5 months ago by Yigit.
May 17, 2017 at 5:55 pm #794999Hey!
Please try using the code as following
add_action( 'ava_after_main_menu', 'enfold_customization_header_widget_area' ); function enfold_customization_header_widget_area() { if(is_page(59)){ dynamic_sidebar( 'header' ); } }
You can simply replace “59” page ID with your pages ID so widget will be displayed on header only on that certain page.
If that is not what you meant, please elaborate on the changes you would like to make :)
Best regards,
YigitMay 18, 2017 at 1:26 pm #795859Hey!
I created custom header using mentioned aproach. And this header now shows on all my pages. What i need now, is to create a new custom (different) header (say ‘header2’) and this header must showing up on specific page (for example at page ID59). So tell me if i correctly understood you:
1) I must copy-paste this code to functions.php (without removing old one)
2) Create new header via Appeariance-Widgets named header2
3) Add to the widget block information.
5) See my new custom information on this specific pageCorrect?
- This reply was modified 7 years, 6 months ago by Max Miko.
May 19, 2017 at 5:04 am #796295Hi,
The steps you listed should work yes, did you try it out and did you have any luck with it?
Best regards,
RikardMay 19, 2017 at 4:07 pm #796633Hey, Rikard!
Yes, this aprouch with little customization worked well for pages.
But one more question, how to get the same result for WooCommerce single product pages?
I tried to add ID’s to code – doesn’t work. I tried to add this:add_action( 'ava_after_main_menu', 'enfold_customization_header_widget_area3' ); function enfold_customization_header_widget_area3() { if(is_product()){ dynamic_sidebar( 'header2' ); } }
also doesn’t work. Tried to add is_category replacing is_product – aslo do not worked.
What i do wrong?
May 22, 2017 at 10:06 pm #797929Hi,
Instead of is_product use is_single with the product id and let us know if it works
Best regards,
BasilisMay 25, 2017 at 12:45 pm #799497Hey Basilis!
Works like a magic! Thanks, for so quick respond! Would be happy, if you explain what to do if i want to do the same for whole category of the products (eg. i have P1, P2, P3 products under category: ‘category-one’). Because it is time consuming to write each ID. I’ve done it already, but in advance it would be helpfull to know.
But in general my problem is solved, thanks one more time!
May 25, 2017 at 12:52 pm #799499Hey!
Please check out this post – https://docs.woocommerce.com/document/conditional-tags/ to find correct conditional tags :)
Glad we could help! Let us know if you have any other questions or issues!
Cheers!
YigitMay 26, 2017 at 3:06 pm #800161Thanks a lot!
May 26, 2017 at 3:52 pm #800192 -
AuthorPosts
- The topic ‘Header for specific page’ is closed to new replies.